MekHQ Nightly CI #2142
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: MekHQ Nightly CI | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 3 * * *" | |
| env: | |
| GRADLE_OPTS: "-Dscan.link.VCS=https://github.com/MegaMek/mekhq/commit/${{ github.sha }}" | |
| jobs: | |
| nightly_ci: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ ubuntu-latest ] | |
| java-distribution: [ temurin ] | |
| java-version: [ 17, 21, 25 ] | |
| fail-fast: false | |
| name: Nightly MekHQ CI ${{ matrix.os }} on ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }} | |
| steps: | |
| - name: Checkout Data Repo | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: megamek/mm-data | |
| path: mm-data | |
| - uses: actions/checkout@v6 | |
| with: | |
| path: mekhq | |
| - name: Checkout MegaMek | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: MegaMek/megamek | |
| path: megamek | |
| - name: Add MM Hash | |
| run: | | |
| cd megamek | |
| calculatedSha=$(git rev-parse HEAD) | |
| echo "$calculatedSha" >> megamek/docs/mm-revision.txt | |
| - name: Checkout MegaMekLab | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: MegaMek/megameklab | |
| path: megameklab | |
| - name: Add MML Hash | |
| run: | | |
| cd megameklab | |
| calculatedSha=$(git rev-parse HEAD) | |
| echo "$calculatedSha" >> megameklab/docs/mml-revision.txt | |
| - name: Set up ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }} | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: ${{ matrix.java-distribution }} | |
| java-version: ${{ matrix.java-version }} | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| with: | |
| build-scan-publish: true | |
| build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" | |
| build-scan-terms-of-use-agree: "yes" | |
| - name: Add MHQRevision file | |
| run: | | |
| echo ${{ github.sha }} >> mekhq/MekHQ/mhq-revision.txt | |
| - name: Set short git commit SHA | |
| id: vars | |
| run: | | |
| cd mekhq | |
| calculatedSha=$(git rev-parse --short ${{ github.sha }}) | |
| echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV | |
| - name: "Output branch information to Version file" | |
| run: | | |
| echo "branch=nightly" >> megamek/megamek/resources/extraVersion.properties | |
| echo "gitHash=$(date +'%Y-%m-%d')" >> megamek/megamek/resources/extraVersion.properties | |
| - name: Test All | |
| working-directory: mekhq | |
| run: ./gradlew testAll | |
| - name: Upload Test Logs on Failure | |
| uses: actions/upload-artifact@v6 | |
| if: failure() | |
| with: | |
| name: cd-failure-logs | |
| path: ./mekhq/MekHQ/build/reports/ | |
| - name: Build with Gradle | |
| working-directory: mekhq | |
| run: ./gradlew build -x test -PextraVersion="nightly-$(date +'%Y-%m-%d')" | |
| - name: CodeCov.io Coverage Report | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| directory: ./mekhq/MekHQ/build/reports/jacoco/test | |
| fail_ci_if_error: false | |
| verbose: true | |
| - name: Upload Tar GZ Artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: mhq-release-tgz-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }} | |
| path: mekhq/MekHQ/build/distributions/*.tar.gz |