-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Don't store cache of Maven packages for PR builds (#399)
* chore: Don't store GitHub cache for Maven packages in PR builds * chore: Don't store GitHub cache for Maven packages in PR builds
- Loading branch information
1 parent
ef5f966
commit 712795e
Showing
4 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,10 +24,17 @@ jobs: | |
distribution: 'adopt' | ||
cache: maven | ||
- name: Cache Maven packages | ||
uses: actions/[email protected] | ||
id: restore-maven-package-cache | ||
uses: actions/cache/[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' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,7 +74,8 @@ jobs: | |
if: matrix.os == 'ubuntu-latest' | ||
|
||
- name: Cache Maven packages | ||
uses: actions/[email protected] | ||
id: restore-maven-package-cache | ||
uses: actions/cache/[email protected] | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
|
@@ -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 ] | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ jobs: | |
distribution: 'adopt' | ||
|
||
- name: Cache Maven packages | ||
uses: actions/[email protected] | ||
uses: actions/cache/restore@v4.0.2 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
|