Skip to content

Commit 5dbcfa1

Browse files
committed
Adjust caching solution
Instead of a separate cache step, add caching as functionality to the setup-java step. This will simplify the GitHub Actions.
1 parent e215b13 commit 5dbcfa1

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,11 @@ jobs:
2828
with:
2929
distribution: 'zulu'
3030
java-version: ${{ matrix.java-version }}
31+
cache: "maven"
3132
server-id: sonatype
3233
server-username: MAVEN_USERNAME
3334
server-password: MAVEN_PASSWORD
3435

35-
- name: Cache .m2
36-
uses: actions/cache@v2.1.7
37-
with:
38-
path: ~/.m2/repository
39-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
40-
restore-keys: |
41-
${{ runner.os }}-maven
42-
4336
- name: Regular Build
4437
if: ${{ !matrix.sonar-enabled }}
4538
run: |

.github/workflows/pullrequest.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,11 @@ jobs:
2525
with:
2626
distribution: 'zulu'
2727
java-version: ${{ matrix.java-version }}
28+
cache: "maven"
2829
server-id: sonatype
2930
server-username: MAVEN_USERNAME
3031
server-password: MAVEN_PASSWORD
3132

32-
- name: Cache .m2
33-
uses: actions/cache@v2.1.7
34-
with:
35-
path: ~/.m2/repository
36-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
37-
restore-keys: |
38-
${{ runner.os }}-maven
39-
4033
- name: Regular Build
4134
if: ${{ !matrix.sonar-enabled }}
4235
run: |

0 commit comments

Comments
 (0)