Fixed #11824 #6918
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: [push, workflow_dispatch] | |
| permissions: {} | |
| jobs: | |
| runPush: | |
| permissions: | |
| contents: write # for Update bundles | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Trigger BE build | |
| if: ${{ github.repository == 'Anuken/Mindustry' }} | |
| run: | | |
| git clone --depth=1 --branch=master https://github.com/Anuken/MindustryBuilds ../MindustryBuilds | |
| cd ../MindustryBuilds | |
| BNUM=$(($GITHUB_RUN_NUMBER + 20000)) | |
| git tag ${BNUM} | |
| git config --global user.name "Github Actions" | |
| git push https://Anuken:${{ secrets.API_TOKEN_GITHUB }}@github.com/Anuken/MindustryBuilds ${BNUM} | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v1 | |
| with: | |
| java-version: 17 | |
| - name: Fetch latest Arc | |
| run: git clone --depth=1 --branch=master https://github.com/Anuken/Arc ../Arc | |
| - name: Setup Gradle | |
| uses: gradle/gradle-build-action@v2 | |
| - name: Update bundles | |
| if: ${{ github.repository == 'Anuken/Mindustry' }} | |
| run: | | |
| ./gradlew updateBundles | |
| if [ -n "$(git status --porcelain)" ]; then | |
| git config --global user.name "Github Actions" | |
| git config --global user.email "actions@github.com" | |
| git add core/assets/bundles/* | |
| git commit -m "Automatic bundle update" | |
| git push | |
| fi | |
| - name: Update scripts and class mappings | |
| if: ${{ github.repository == 'Anuken/Mindustry' }} | |
| run: | | |
| ./gradlew updateScripts | |
| if [ -n "$(git status --porcelain)" ]; then | |
| git config --global user.name "Github Actions" | |
| git config --global user.email "actions@github.com" | |
| git add core/assets/scripts/* core/src/mindustry/mod/ClassMap.java | |
| git commit -m "Automatic class mapping update" | |
| git push | |
| fi | |
| - name: Update JITpack repo | |
| if: ${{ github.repository == 'Anuken/Mindustry' }} | |
| run: | | |
| git config --global user.name "Github Actions" | |
| git config --global user.email "actions@github.com" | |
| cd ../ | |
| cp -r ./Mindustry ./MindustryJitpack | |
| cd MindustryJitpack | |
| git clone --depth 1 https://github.com/Anuken/MindustryJitpack.git | |
| rm -rf .git | |
| cp -r ./MindustryJitpack/.git ./.git | |
| rm -rf MindustryJitpack | |
| rm -rf .github | |
| rm README.md | |
| git add . | |
| git commit --allow-empty -m "Updating" | |
| git push https://Anuken:${{ secrets.API_TOKEN_GITHUB }}@github.com/Anuken/MindustryJitpack | |
| cd ../Mindustry | |
| - name: Run unit tests | |
| run: ./gradlew tests:test --rerun --stacktrace |