Skip to content

Commit b33e934

Browse files
authored
Java GitHub Action now has caching built in
1 parent cbe8548 commit b33e934

1 file changed

Lines changed: 3 additions & 19 deletions

File tree

.github/workflows/maven-build.yml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,7 @@ jobs:
2929
with:
3030
java-version: ${{ matrix.java }}
3131
distribution: 'zulu'
32-
- name: Cached .m2
33-
uses: actions/[email protected]
34-
with:
35-
path: ~/.m2/repository
36-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
37-
restore-keys: |
38-
${{ runner.os }}-maven-
32+
cache: 'maven'
3933
- name: Maven Install (skipTests)
4034
env:
4135
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
@@ -54,12 +48,7 @@ jobs:
5448
with:
5549
java-version: ${{ matrix.java }}
5650
distribution: 'adopt'
57-
- uses: actions/[email protected]
58-
with:
59-
path: ~/.m2/repository
60-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
61-
restore-keys: |
62-
${{ runner.os }}-maven-
51+
cache: 'maven'
6352
- name: Maven Site
6453
run: mvn -B clean site -D enable-ci --file pom.xml
6554
test:
@@ -77,12 +66,7 @@ jobs:
7766
with:
7867
java-version: ${{ matrix.java }}
7968
distribution: 'zulu'
80-
- uses: actions/[email protected]
81-
with:
82-
path: ~/.m2/repository
83-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
84-
restore-keys: |
85-
${{ runner.os }}-maven-
69+
cache: 'maven'
8670
# JDK 8
8771
- name: Maven Install without Code Coverage
8872
if: matrix.os == 'windows' && startsWith(matrix.java, '8')

0 commit comments

Comments
 (0)