Skip to content

Commit

Permalink
Merge pull request #306 from apupier/305-mavenCaching
Browse files Browse the repository at this point in the history
chore(305): use built-in Maven cache mechanism of setup-java GitHub Action
  • Loading branch information
juancho0202 authored Mar 6, 2024
2 parents 9b912c8 + 9de8fc5 commit b57e3db
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 25 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/build-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ jobs:
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Set up Docker Buildx
id: buildx
Expand All @@ -43,6 +37,7 @@ jobs:
with:
distribution: 'zulu'
java-version: '17'
cache: 'maven'

- name: Create custom Maven Settings.xml
uses: whelk-io/maven-settings-xml-action@v21
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ jobs:
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
- name: Cache Maven packages
if: ${{ steps.release.outputs.release_created }}
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Extract tag name
if: ${{ steps.release.outputs.release_created }}
Expand All @@ -53,6 +46,7 @@ jobs:
with:
distribution: 'zulu'
java-version: '17'
cache: 'maven'
- name: Set up Docker Buildx
if: ${{ steps.release.outputs.release_created }}
id: buildx
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/sonarcloud-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,13 @@ jobs:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
cache: 'maven'

- name: Set Common Sonar Variables
id: sonar_env
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/sonarcloud-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,13 @@ jobs:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
cache: 'maven'

- name: Create custom Maven Settings.xml
uses: whelk-io/maven-settings-xml-action@v21
Expand Down

0 comments on commit b57e3db

Please sign in to comment.