Skip to content

MekHQ Nightly Maven CI #445

MekHQ Nightly Maven CI

MekHQ Nightly Maven CI #445

# 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: [ 11, 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/