Bump actions/cache from 4.1.2 to 4.2.0 #1226
This file contains 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
# This workflow will build a Java project with Maven | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
name: Java CI with Maven | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ master ] | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Cache local Maven repository | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
with: | |
path: | | |
~/.m2/repository | |
~/.m2/wrapper | |
key: ${{ runner.os }}-build-maven-${{ hashFiles('**/pom.xml', '**/maven-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-build-maven- | |
- name: Set up JDK | |
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 | |
with: | |
distribution: 'zulu' | |
java-version: '21' | |
check-latest: true | |
- name: Build with Maven | |
run: ./mvnw -B -V -e verify -DskipTests=true -DskipITs=true | |
- name: Archive target directory | |
run: tar -cf target.tar target | |
- name: Upload target directory archive | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: build_target | |
path: target.tar | |
test: | |
needs: build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
java: ['8', '11', '17', '21', '23'] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Cache local Maven repository | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
with: | |
path: | | |
~/.m2/repository | |
~/.m2/wrapper | |
key: ${{ runner.os }}-test-${{ matrix.java }}-maven-${{ hashFiles('**/pom.xml', '**/maven-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-test-${{ matrix.java }}-maven- | |
- name: Set up JDK | |
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 | |
with: | |
distribution: 'zulu' | |
java-version: ${{ matrix.java }} | |
check-latest: true | |
- name: Download target directory archive | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
name: build_target | |
- name: Extract target directory archive | |
run: tar -xmf target.tar | |
- name: Test with Maven | |
run: ./mvnw -B -V -e -Pcoverage verify -Denforcer.skip=true -Dmaven.resources.skip=true -Dflatten.skip=true -Dmaven.main.skip=true -Dbnd.skip=true -Dassembly.skipAssembly=true -Dmaven.javadoc.skip=true -Dcyclonedx.skip=true -Dformatter.skip=true -Dforbiddenapis.skip=true -DskipTests=false -DskipITs=false | |
- name: Upload test results | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: java-${{ matrix.java }}-testresults | |
path: | | |
**/target/surefire-reports/ | |
**/target/failsafe-reports/ | |
**/target/site/jacoco/ | |
**/target/site/jacoco-it/ | |
if: always() |