Skip to content

Commit

Permalink
Update the handling of GHA's new cache
Browse files Browse the repository at this point in the history
  • Loading branch information
linghengqian committed Oct 14, 2022
1 parent a609ff4 commit ab9abe9
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: shardingsphere-maven-third-party-${{ hashFiles('**/pom.xml') }}
key: shardingsphere-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
shardingsphere-maven-third-party-
${{ runner.os }}-maven-
- name: Run checkstyle
run: ./mvnw checkstyle:check -T1C

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: shardingsphere-maven-third-party-${{ hashFiles('**/pom.xml') }}
key: shardingsphere-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
shardingsphere-maven-third-party-
${{ runner.os }}-maven-
- name: Maven resolve ranges
run: ./mvnw versions:resolve-ranges -ntp -Dincludes='org.springframework:*,org.springframework.boot:*'
- name: Build prod with Maven
Expand All @@ -88,9 +88,9 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: shardingsphere-maven-third-party-${{ hashFiles('**/pom.xml') }}
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
shardingsphere-maven-third-party-
${{ runner.os }}-maven-
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: shardingsphere-maven-third-party-${{ hashFiles('**/pom.xml') }}
key: shardingsphere-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
shardingsphere-maven-third-party-
${{ runner.os }}-maven-
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/it-scaling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,9 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: shardingsphere-maven-third-party-it-cache-${{ github.sha }}
key: shardingsphere-it-cache-${{ github.sha }}
restore-keys: |
shardingsphere-maven-third-party-it-cache-
shardingsphere-maven-third-party-
${{ runner.os }}-maven-
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
Expand Down Expand Up @@ -117,10 +116,7 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: shardingsphere-maven-third-party-it-cache-${{ github.sha }}
restore-keys: |
shardingsphere-maven-third-party-it-cache-
shardingsphere-maven-third-party-
key: shardingsphere-it-cache-${{ github.sha }}
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/it-transaction.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: shardingsphere-maven-third-party-it-cache${{ github.sha }}
key: shardingsphere-it-cache-${{ github.sha }}
restore-keys: |
shardingsphere-maven-third-party-it-cache
shardingsphere-maven-third-party-
${{ runner.os }}-maven-
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,9 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: shardingsphere-maven-third-party-it-cache-${{ github.sha }}
key: shardingsphere-it-cache-${{ github.sha }}
restore-keys: |
shardingsphere-maven-third-party-it-cache-
shardingsphere-maven-third-party-
${{ runner.os }}-maven-
- name: Maven resolve ranges
run: ./mvnw versions:resolve-ranges -ntp -Dincludes='org.springframework:*,org.springframework.boot:*'
- name: Build IT image
Expand Down Expand Up @@ -109,7 +108,7 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: shardingsphere-maven-third-party-it-cache-${{ github.sha }}
key: shardingsphere-it-cache-${{ github.sha }}
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
Expand Down Expand Up @@ -146,7 +145,7 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: shardingsphere-maven-third-party-it-cache-${{ github.sha }}
key: shardingsphere-it-cache-${{ github.sha }}
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
Expand Down Expand Up @@ -183,7 +182,7 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: shardingsphere-maven-third-party-it-cache-${{ github.sha }}
key: shardingsphere-it-cache-${{ github.sha }}
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
Expand Down Expand Up @@ -212,9 +211,9 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: shardingsphere-maven-third-party-${{ hashFiles('**/pom.xml') }}
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
shardingsphere-maven-third-party-
${{ runner.os }}-maven-
- name: Maven resolve ranges
run: ./mvnw versions:resolve-ranges -ntp -Dincludes='org.springframework:*,org.springframework.boot:*'
- name: Build Project
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: shardingsphere-maven-third-party-cache-${{ github.sha }}
key: shardingsphere-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
shardingsphere-maven-third-party-cache-
shardingsphere-maven-third-party-
${{ runner.os }}-maven-
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/nightly-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: shardingsphere-maven-third-party-cache-${{ github.sha }}
key: shardingsphere-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
shardingsphere-maven-third-party-cache-
shardingsphere-maven-third-party-
${{ runner.os }}-maven-
- name: Build prod with Maven
run: ./mvnw -T1C -B -ntp clean install
- name: Build examples with Maven
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/nightly-it-example-generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,9 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: shardingsphere-maven-third-party-cache-${{ github.sha }}
key: shardingsphere-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
shardingsphere-maven-third-party-cache-
shardingsphere-maven-third-party-
${{ runner.os }}-maven-
- name: Maven resolve ranges
run: ./mvnw versions:resolve-ranges -ntp -Dincludes='org.springframework:*,org.springframework.boot:*'
- name: Build with Maven
Expand Down

0 comments on commit ab9abe9

Please sign in to comment.