From 06ae1dc849a42a81b27b7837ff11396a68a2eec6 Mon Sep 17 00:00:00 2001 From: Jeremy Landis Date: Thu, 4 Apr 2024 22:49:40 -0400 Subject: [PATCH] [GHA] Update github actions - Allow any branch, we are not the github police - Allow jdk 21 - Use built in caching - Use maven wrapper --- .github/workflows/maven.yaml | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index 5e45454..69940fc 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -3,35 +3,28 @@ name: mvn verify -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] +on: [push, pull_request, workflow_dispatch] jobs: build: strategy: matrix: os: [ubuntu-latest, windows-latest, macOS-latest] - java: [17] + java: [17, 21] 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: 'maven' + - name: Download Maven Wrapper + run: mvn wrapper:wrapper "-Dmaven=3.9.6" - 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