Skip to content

Commit

Permalink
chore: Don't store GitHub cache for Maven packages in PR builds
Browse files Browse the repository at this point in the history
  • Loading branch information
mthmulders committed Aug 8, 2024
1 parent a7ed350 commit 2333d21
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,17 @@ jobs:
distribution: 'adopt'
cache: maven
- name: Cache Maven packages
id: restore-maven-package-cache
uses: actions/[email protected]
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: mvn -B verify
- name: Save downloaded Maven packages
uses: actions/cache/[email protected]
with:
path: ~/.m2
key: ${{ steps.restore-maven-package-cache.outputs.cache-primary-key }}
if: github.event_name != 'pull_request'
8 changes: 8 additions & 0 deletions .github/workflows/early-access.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ jobs:
if: matrix.os == 'ubuntu-latest'

- name: Cache Maven packages
id: restore-maven-package-cache
uses: actions/[email protected]
with:
path: ~/.m2
Expand Down Expand Up @@ -103,6 +104,13 @@ jobs:
target/distributions/*.zip
target/distributions/*.tar.gz
- name: Save downloaded Maven packages
uses: actions/cache/[email protected]
with:
path: ~/.m2
key: ${{ steps.restore-maven-package-cache.outputs.cache-primary-key }}
if: github.event_name != 'pull_request'

# Collect all executables and release
release:
needs: [ build ]
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/mutation-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ jobs:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0

- name: Cache Maven packages
uses: actions/[email protected]
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Set up JDK
uses: actions/[email protected]
with:
Expand Down

0 comments on commit 2333d21

Please sign in to comment.