Skip to content

Commit 154c9d2

Browse files
committed
CI: cache ~/.m2/repository correctly
1 parent bcd3277 commit 154c9d2

File tree

2 files changed

+4
-24
lines changed

2 files changed

+4
-24
lines changed

.github/workflows/build-main.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,12 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@v2
16-
- name: Cache local Maven repository
17-
uses: actions/cache@v2
18-
env:
19-
cache-name: cache-m2
20-
with:
21-
path: ~/.m2/repository
22-
key: ${{ runner.os }}-build-${{ env.cache-name }}
23-
restore-keys: |
24-
${{ runner.os }}-build-${{ env.cache-name }}-
25-
${{ runner.os }}-build-
26-
${{ runner.os }}-
2716
- name: Set up Java
28-
uses: actions/setup-java@v2
17+
uses: actions/setup-java@v3
2918
with:
3019
java-version: '8'
3120
distribution: 'zulu'
21+
cache: 'maven'
3222
- name: Set up CI environment
3323
run: .github/setup.sh
3424
- name: Execute the build

.github/workflows/build-pr.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,12 @@ jobs:
1111

1212
steps:
1313
- uses: actions/checkout@v2
14-
- name: Cache local Maven repository
15-
uses: actions/cache@v2
16-
env:
17-
cache-name: cache-m2
18-
with:
19-
path: ~/.m2/repository
20-
key: ${{ runner.os }}-build-${{ env.cache-name }}
21-
restore-keys: |
22-
${{ runner.os }}-build-${{ env.cache-name }}-
23-
${{ runner.os }}-build-
24-
${{ runner.os }}-
2514
- name: Set up Java
26-
uses: actions/setup-java@v2
15+
uses: actions/setup-java@v3
2716
with:
2817
java-version: '8'
2918
distribution: 'zulu'
19+
cache: 'maven'
3020
- name: Set up CI environment
3121
run: .github/setup.sh
3222
- name: Execute the build

0 commit comments

Comments
 (0)