diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3e48f62b2..19ea5b0fb5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -131,12 +131,12 @@ jobs: # If the build step fails, try to upload any test logs in case it was a unit test failure. # The logs will be relative to the ./mekhq directory. - # - name: Upload Test Logs on Failure - # uses: actions/upload-artifact@v3 - # if: failure() - # with: - # name: cd-failure-logs - # path: ./mekhq/MekHQ/build/reports/ + - name: Upload Test Logs on Failure + uses: actions/upload-artifact@v4 + if: failure() + with: + name: cd-failure-logs + path: ./mekhq/MekHQ/build/reports/ # Upload our Code Coverage Reports to CodeCov.io - name: CodeCov.io Coverage Report @@ -146,25 +146,13 @@ jobs: fail_ci_if_error: false verbose: true - # If we have a buildScanUri comment on the PR - # - # NB: This only works if you're on the main MegaMek\mekhq repo - # for now due to a GitHub Actions limitation. - # CAW: temporarily halted https://github.com/thollander/actions-comment-pull-request/issues/17 - # - name: Comment on PR with Build Scan URI - # uses: thollander/actions-comment-pull-request@master - # if: always() && steps.gradle_build.outputs.buildScanUri != '' - # with: - # message: Build scan available at ${{ steps.gradle_build.outputs.buildScanUri }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # Put the Windows Release in an artifact # NB: Due to a GitHub Actions limitation we won't know what the filename is in order to display it somewhere. - name: Upload Windows Release uses: actions/upload-artifact@v4 with: name: mhq-release-win-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }} - path: ./mekhq/MekHQ/build/distributions/mekhq-windows-*.zip + path: ./mekhq/MekHQ/build/distributions/*.zip # Put the non-Windows release in an artifact - name: Upload Nix/Mac Release diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index b99e5e0b37..9f18d8cfb1 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -34,13 +34,6 @@ jobs: with: path: mekhq - # Setup composite build for MekHQ - # See: https://github.com/MegaMek/megamek/wiki/Working-With-Gradle - - name: Setup Composite Build for MekHQ - run: | - echo "includeBuild '../megamek'" >./mekhq/settings_local.gradle - echo "includeBuild '../megameklab'" >>./mekhq/settings_local.gradle - # Checkout the latest MegaMek source and put it in: ./megamek - name: Checkout MegaMek uses: actions/checkout@v4 @@ -55,11 +48,13 @@ jobs: repository: MegaMek/megameklab path: megameklab - # Setup composite build for MegaMekLab + # Setup composite build for MekHQ # See: https://github.com/MegaMek/megamek/wiki/Working-With-Gradle - - name: Setup Composite Build for MegaMekLab + - name: Setup Composite Build for MekHQ run: | - echo "if (gradle.parent == null) includeBuild '../megamek'" >./megameklab/settings_local.gradle + echo "includeBuild '../megamek'" >> ./mekhq/settings_local.gradle + echo "includeBuild '../megameklab'" >> ./mekhq/settings_local.gradle + echo "includeBuild '../megamek'" >> ./megameklab/settings_local.gradle # Setup the requested Java Distribution and Version from the matrix - name: Set up ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }} @@ -68,27 +63,12 @@ jobs: distribution: ${{ matrix.java-distribution }} java-version: ${{ matrix.java-version }} - # Make sure we can execute the Gradle wrapper - - name: Grant execute permission for gradlew (*nix or MacOS) - working-directory: mekhq - run: chmod +x gradlew - if: runner.os != 'Windows' + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 - # Build the MekHQ project - # - # Directory layout: - # /mekhq - # /gradlew - # /megamek - # /megameklab - # - # Output Variables: - # - buildScanUri - name: Build with Gradle - uses: gradle/actions/setup-gradle@v3 - with: - arguments: clean build --no-build-cache --info --stacktrace --max-workers=1 --scan - build-root-directory: mekhq + working-directory: mekhq + run: ./gradlew test # If the build step fails, try to upload any test logs in case it was a unit test failure. # diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index aee8c69a2c..755b59a0e6 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -14,7 +14,6 @@ on: push: branches: [master] pull_request: - # The branches below must be a subset of the branches above branches: [master] schedule: - cron: "24 16 * * 4" @@ -141,8 +140,8 @@ jobs: uses: gradle/actions/setup-gradle@v3 - name: Build with Gradle - working-directory: mekhq - run: ./gradlew build --stacktrace --scan + working-directory: megameklab + run: ./gradlew jar - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/nightly-ci.yml b/.github/workflows/nightly-ci.yml index d23cc9a6b3..ca010ae5b4 100644 --- a/.github/workflows/nightly-ci.yml +++ b/.github/workflows/nightly-ci.yml @@ -34,13 +34,6 @@ jobs: with: path: mekhq - # Setup composite build for MekHQ - # See: https://github.com/MegaMek/megamek/wiki/Working-With-Gradle - - name: Setup Composite Build for MekHQ - run: | - echo "includeBuild '../megamek'" >./mekhq/settings_local.gradle - echo "includeBuild '../megameklab'" >>./mekhq/settings_local.gradle - # Checkout the latest MegaMek source and put it in: ./megamek - name: Checkout MegaMek uses: actions/checkout@v4 @@ -55,11 +48,13 @@ jobs: repository: MegaMek/megameklab path: megameklab - # Setup composite build for MegaMekLab + # Setup composite build for MekHQ # See: https://github.com/MegaMek/megamek/wiki/Working-With-Gradle - - name: Setup Composite Build for MegaMekLab + - name: Setup Composite Build for MekHQ run: | - echo "if (gradle.parent == null) includeBuild '../megamek'" >./megameklab/settings_local.gradle + echo "includeBuild '../megamek'" >> ./mekhq/settings_local.gradle + echo "includeBuild '../megameklab'" >> ./mekhq/settings_local.gradle + echo "includeBuild '../megamek'" >> ./megameklab/settings_local.gradle # Setup the requested Java Distribution and Version from the matrix - name: Set up ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }} @@ -68,18 +63,12 @@ jobs: distribution: ${{ matrix.java-distribution }} java-version: ${{ matrix.java-version }} - # Don't run this for Windows. - - name: Grant execute permission for gradlew (*nix or MacOS) - working-directory: mekhq - run: chmod +x gradlew - if: runner.os != 'Windows' + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 - # Include --stacktrace to make some build failures easier to figure out. - name: Build with Gradle - uses: gradle/actions/setup-gradle@v3 - with: - arguments: clean build -x test --continue --stacktrace --max-workers=1 --scan - build-root-directory: mekhq + working-directory: megameklab + run: ./gradlew clean build -x test --continue --stacktrace --scan - name: Upload Test Logs on Failure uses: actions/upload-artifact@v4 @@ -106,4 +95,4 @@ jobs: if: always() && matrix.os == 'windows-latest' with: name: mhq-release-win-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }} - path: mekhq/MekHQ/build/distributions/mekhq-windows-*.zip + path: mekhq/MekHQ/build/distributions/*.zip diff --git a/.github/workflows/nightly-maven-ci.yml b/.github/workflows/nightly-maven-ci.yml deleted file mode 100644 index 64a8185b88..0000000000 --- a/.github/workflows/nightly-maven-ci.yml +++ /dev/null @@ -1,81 +0,0 @@ -# Builds MekHQ for CI each Night using our Maven Repo. -# -# Jobs: -# - nightly_maven_ci: Build MekHQ for CI using our Maven Repos -name: MekHQ Nightly Maven CI - -on: - schedule: - # Nightly at Midnight (UTC) - # ref: https://crontab.guru/every-night - - cron: "0 0 * * *" - -# Setup the Build Scan "VCS" link for all gradle invocations -# -# Disable maven pooling to deal with Azure SNAT resets -# https://github.com/actions/virtual-environments/issues/1499#issuecomment-689467080 -env: - GRADLE_OPTS: "-Dscan.link.VCS=https://github.com/MegaMek/mekhq/commit/${{ github.sha }} -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120" - -jobs: - nightly_maven_ci: - runs-on: ${{ matrix.os }} - - # Run this job once for each combination in the matrix below. - strategy: - matrix: - os: [ubuntu-latest, windows-latest] - java-distribution: [temurin] - java-version: [17] - fail-fast: false - - name: Nightly MekHQ Maven CI ${{ matrix.os }} on ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }} - - steps: - # Checkout the latest source and put it in: ./mekhq - - uses: actions/checkout@v4 - with: - path: mekhq - - # Composite Build is NOT setup for this job. - - # Checkout the latest MegaMek source and put it in: ./megamek - - name: Checkout MegaMek - uses: actions/checkout@v4 - with: - repository: MegaMek/megamek - path: megamek - - # Checkout the latest MegaMekLab source and put it in: ./megameklab - - name: Checkout MegaMekLab - uses: actions/checkout@v4 - with: - repository: MegaMek/megameklab - path: megameklab - - # Setup the requested Java Distribution and Version from the matrix - - name: Set up ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }} - uses: actions/setup-java@v4 - with: - distribution: ${{ matrix.java-distribution }} - java-version: ${{ matrix.java-version }} - - # Don't run this for Windows. - - name: Grant execute permission for gradlew (*nix or MacOS) - working-directory: mekhq - run: chmod +x gradlew - if: runner.os != 'Windows' - - # Include --stacktrace to make some build failures easier to figure out. - - name: Build with Gradle - uses: gradle/actions/setup-gradle@v3 - with: - arguments: clean build --continue --stacktrace --max-workers=1 --scan - build-root-directory: mekhq - - - name: Upload Test Logs on Failure - uses: actions/upload-artifact@v4 - if: failure() - with: - name: ${{ matrix.os }}-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }}-maven-ci-failure-logs - path: mekhq/MekHQ/build/reports/