From c3a9e44cd6223849111ac8cfcf8fdcb02aeeb116 Mon Sep 17 00:00:00 2001 From: Jeremy Landis Date: Thu, 4 Apr 2024 22:47:59 -0400 Subject: [PATCH 1/2] [GHA] Rework github actions - Allow any branch to build as it is not on us to enforce downstream repo usage. Has zero effect on this repo. - Make sure we test latest LTS release of java and last LTS. - Use githubs built in caching for maven --- .github/workflows/maven.yaml | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index 5e45454..d019d57 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -3,35 +3,29 @@ name: mvn verify -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] +on: [push, pull_request, workflow_dispatch] jobs: build: strategy: matrix: + cache: [maven] + java: [11, 17, 21] os: [ubuntu-latest, windows-latest, macOS-latest] - java: [17] fail-fast: false runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - name: Set up JDK + - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: zulu - - name: Cache local maven repository - uses: actions/cache@v4 - with: - path: ~/.m2 - key: ${{ matrix.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ matrix.os }}-m2 + distribution: temurin + cache: ${{ matrix.cache }} + - name: Download Maven Wrapper + run: mvn wrapper:wrapper "-Dmaven=3.9.7" - name: Build with Maven - run: mvn -B -V -e "-Dstyle.color=always" verify -DskipFormat -DverifyFormat + run: ./mvnw -B -V -e "-Dstyle.color=always" verify -DskipFormat -DverifyFormat env: MAVEN_OPTS: -Djansi.force=true From 8f376a75f92b284a31f121949ff2ad3e26b9cdea Mon Sep 17 00:00:00 2001 From: Jeremy Landis Date: Mon, 27 May 2024 15:10:18 -0400 Subject: [PATCH 2/2] [GHA] Remove java 11 as code base is java 17+ only --- .github/workflows/maven.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index d019d57..aa8d167 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -10,7 +10,7 @@ jobs: strategy: matrix: cache: [maven] - java: [11, 17, 21] + java: [17, 21] os: [ubuntu-latest, windows-latest, macOS-latest] fail-fast: false runs-on: ${{ matrix.os }}