Skip to content

Commit

Permalink
GH Actions: use cache feature of "setup-java"
Browse files Browse the repository at this point in the history
  • Loading branch information
andrus committed Apr 21, 2024
1 parent e81e69b commit 05c9885
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,7 @@ jobs:
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'

- name: Retrieve mvn repo cache...
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-build-v1
restore-keys: ${{ runner.os }}-maven
cache: 'maven'

- name: Build and test...
run: mvn clean verify -U
Expand All @@ -52,15 +46,7 @@ jobs:
with:
java-version: 11
distribution: 'temurin'

- name: Retrieve mvn repo cache...
uses: actions/cache@v4
# skip this for the release versions
if: contains(env.POM_VERSION, '-SNAPSHOT')
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-build-v1
restore-keys: ${{ runner.os }}-maven
cache: 'maven'

- name: Deploy...
run: mvn clean source:jar-no-fork javadoc:jar deploy -DskipTests --settings .github/workflows/maven_settings.xml
Expand Down

0 comments on commit 05c9885

Please sign in to comment.