Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Don't store cache of Maven packages for PR builds #399

Merged
merged 2 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .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
uses: actions/cache@v4.0.2
id: restore-maven-package-cache
uses: actions/cache/restore@v4.0.2
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/save@v4.0.2
with:
path: ~/.m2
key: ${{ steps.restore-maven-package-cache.outputs.cache-primary-key }}
if: github.event_name != 'pull_request'
10 changes: 9 additions & 1 deletion .github/workflows/early-access.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ jobs:
if: matrix.os == 'ubuntu-latest'

- name: Cache Maven packages
uses: actions/cache@v4.0.2
id: restore-maven-package-cache
uses: actions/cache/restore@v4.0.2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
Expand Down Expand Up @@ -103,6 +104,13 @@ jobs:
target/distributions/*.zip
target/distributions/*.tar.gz

- name: Save downloaded Maven packages
uses: actions/cache/save@v4.0.2
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/cache@v4.0.2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Set up JDK
uses: actions/setup-java@v4.2.1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
distribution: 'adopt'

- name: Cache Maven packages
uses: actions/cache@v4.0.2
uses: actions/cache/restore@v4.0.2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
Expand Down