Skip to content

Commit ab9abe9

Browse files
committed
Update the handling of GHA's new cache
1 parent a609ff4 commit ab9abe9

9 files changed

+26
-35
lines changed

.github/workflows/check.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ jobs:
5353
- uses: actions/cache@v3
5454
with:
5555
path: ~/.m2/repository
56-
key: shardingsphere-maven-third-party-${{ hashFiles('**/pom.xml') }}
56+
key: shardingsphere-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
5757
restore-keys: |
58-
shardingsphere-maven-third-party-
58+
${{ runner.os }}-maven-
5959
- name: Run checkstyle
6060
run: ./mvnw checkstyle:check -T1C
6161

.github/workflows/ci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ jobs:
6868
- uses: actions/cache@v3
6969
with:
7070
path: ~/.m2/repository
71-
key: shardingsphere-maven-third-party-${{ hashFiles('**/pom.xml') }}
71+
key: shardingsphere-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
7272
restore-keys: |
73-
shardingsphere-maven-third-party-
73+
${{ runner.os }}-maven-
7474
- name: Maven resolve ranges
7575
run: ./mvnw versions:resolve-ranges -ntp -Dincludes='org.springframework:*,org.springframework.boot:*'
7676
- name: Build prod with Maven
@@ -88,9 +88,9 @@ jobs:
8888
uses: actions/cache@v3
8989
with:
9090
path: ~/.m2/repository
91-
key: shardingsphere-maven-third-party-${{ hashFiles('**/pom.xml') }}
91+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
9292
restore-keys: |
93-
shardingsphere-maven-third-party-
93+
${{ runner.os }}-maven-
9494
- uses: actions/setup-java@v3
9595
with:
9696
distribution: 'temurin'

.github/workflows/docker-release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ jobs:
4141
- uses: actions/cache@v3
4242
with:
4343
path: ~/.m2/repository
44-
key: shardingsphere-maven-third-party-${{ hashFiles('**/pom.xml') }}
44+
key: shardingsphere-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
4545
restore-keys: |
46-
shardingsphere-maven-third-party-
46+
${{ runner.os }}-maven-
4747
- uses: actions/setup-java@v3
4848
with:
4949
distribution: 'temurin'

.github/workflows/it-scaling.yml

+3-7
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,9 @@ jobs:
8484
uses: actions/cache@v3
8585
with:
8686
path: ~/.m2/repository
87-
key: shardingsphere-maven-third-party-it-cache-${{ github.sha }}
87+
key: shardingsphere-it-cache-${{ github.sha }}
8888
restore-keys: |
89-
shardingsphere-maven-third-party-it-cache-
90-
shardingsphere-maven-third-party-
89+
${{ runner.os }}-maven-
9190
- name: Set up JDK 8
9291
uses: actions/setup-java@v3
9392
with:
@@ -117,10 +116,7 @@ jobs:
117116
uses: actions/cache@v3
118117
with:
119118
path: ~/.m2/repository
120-
key: shardingsphere-maven-third-party-it-cache-${{ github.sha }}
121-
restore-keys: |
122-
shardingsphere-maven-third-party-it-cache-
123-
shardingsphere-maven-third-party-
119+
key: shardingsphere-it-cache-${{ github.sha }}
124120
- name: Set up JDK 8
125121
uses: actions/setup-java@v3
126122
with:

.github/workflows/it-transaction.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,9 @@ jobs:
7373
uses: actions/cache@v3
7474
with:
7575
path: ~/.m2/repository
76-
key: shardingsphere-maven-third-party-it-cache${{ github.sha }}
76+
key: shardingsphere-it-cache-${{ github.sha }}
7777
restore-keys: |
78-
shardingsphere-maven-third-party-it-cache
79-
shardingsphere-maven-third-party-
78+
${{ runner.os }}-maven-
8079
- name: Set up JDK 8
8180
uses: actions/setup-java@v3
8281
with:

.github/workflows/it.yml

+7-8
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,9 @@ jobs:
7676
- uses: actions/cache@v3
7777
with:
7878
path: ~/.m2/repository
79-
key: shardingsphere-maven-third-party-it-cache-${{ github.sha }}
79+
key: shardingsphere-it-cache-${{ github.sha }}
8080
restore-keys: |
81-
shardingsphere-maven-third-party-it-cache-
82-
shardingsphere-maven-third-party-
81+
${{ runner.os }}-maven-
8382
- name: Maven resolve ranges
8483
run: ./mvnw versions:resolve-ranges -ntp -Dincludes='org.springframework:*,org.springframework.boot:*'
8584
- name: Build IT image
@@ -109,7 +108,7 @@ jobs:
109108
- uses: actions/cache@v3
110109
with:
111110
path: ~/.m2/repository
112-
key: shardingsphere-maven-third-party-it-cache-${{ github.sha }}
111+
key: shardingsphere-it-cache-${{ github.sha }}
113112
- uses: actions/setup-java@v3
114113
with:
115114
distribution: 'temurin'
@@ -146,7 +145,7 @@ jobs:
146145
- uses: actions/cache@v3
147146
with:
148147
path: ~/.m2/repository
149-
key: shardingsphere-maven-third-party-it-cache-${{ github.sha }}
148+
key: shardingsphere-it-cache-${{ github.sha }}
150149
- uses: actions/setup-java@v3
151150
with:
152151
distribution: 'temurin'
@@ -183,7 +182,7 @@ jobs:
183182
- uses: actions/cache@v3
184183
with:
185184
path: ~/.m2/repository
186-
key: shardingsphere-maven-third-party-it-cache-${{ github.sha }}
185+
key: shardingsphere-it-cache-${{ github.sha }}
187186
- uses: actions/setup-java@v3
188187
with:
189188
distribution: 'temurin'
@@ -212,9 +211,9 @@ jobs:
212211
- uses: actions/cache@v3
213212
with:
214213
path: ~/.m2/repository
215-
key: shardingsphere-maven-third-party-${{ hashFiles('**/pom.xml') }}
214+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
216215
restore-keys: |
217-
shardingsphere-maven-third-party-
216+
${{ runner.os }}-maven-
218217
- name: Maven resolve ranges
219218
run: ./mvnw versions:resolve-ranges -ntp -Dincludes='org.springframework:*,org.springframework.boot:*'
220219
- name: Build Project

.github/workflows/nightly-build.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ jobs:
3333
- uses: actions/cache@v3
3434
with:
3535
path: ~/.m2/repository
36-
key: shardingsphere-maven-third-party-cache-${{ github.sha }}
36+
key: shardingsphere-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
3737
restore-keys: |
38-
shardingsphere-maven-third-party-cache-
39-
shardingsphere-maven-third-party-
38+
${{ runner.os }}-maven-
4039
- uses: actions/checkout@v3
4140
- uses: actions/setup-java@v3
4241
with:

.github/workflows/nightly-ci.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@ jobs:
4747
- uses: actions/cache@v3
4848
with:
4949
path: ~/.m2/repository
50-
key: shardingsphere-maven-third-party-cache-${{ github.sha }}
50+
key: shardingsphere-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
5151
restore-keys: |
52-
shardingsphere-maven-third-party-cache-
53-
shardingsphere-maven-third-party-
52+
${{ runner.os }}-maven-
5453
- name: Build prod with Maven
5554
run: ./mvnw -T1C -B -ntp clean install
5655
- name: Build examples with Maven

.github/workflows/nightly-it-example-generator.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,9 @@ jobs:
5959
- uses: actions/cache@v3
6060
with:
6161
path: ~/.m2/repository
62-
key: shardingsphere-maven-third-party-cache-${{ github.sha }}
62+
key: shardingsphere-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
6363
restore-keys: |
64-
shardingsphere-maven-third-party-cache-
65-
shardingsphere-maven-third-party-
64+
${{ runner.os }}-maven-
6665
- name: Maven resolve ranges
6766
run: ./mvnw versions:resolve-ranges -ntp -Dincludes='org.springframework:*,org.springframework.boot:*'
6867
- name: Build with Maven

0 commit comments

Comments
 (0)