Skip to content

Commit

Permalink
Fix cache is overriden randomly after build and before tests (apache#…
Browse files Browse the repository at this point in the history
…14808)

* Fix cache is overriden randomly after build and before tests
* Update backend.yml
* Update unit-test.yml
  • Loading branch information
kezhenxu94 authored Aug 24, 2023
1 parent d62ce25 commit 294a622
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/api-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,15 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-api-test
restore-keys: ${{ runner.os }}-maven-
- name: Build Image
run: |
./mvnw -B clean install \
-Dmaven.test.skip \
-Dmaven.javadoc.skip \
-Dspotless.skip=true \
-Pdocker,release -Ddocker.tag=ci \
-pl dolphinscheduler-standalone-server -am
-Pdocker,release -Ddocker.tag=ci
- name: Export Docker Images
run: |
docker save apache/dolphinscheduler-standalone-server:ci -o /tmp/standalone-image.tar \
Expand Down Expand Up @@ -112,7 +111,7 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-api-test
restore-keys: ${{ runner.os }}-maven-
- uses: actions/download-artifact@v2
name: Download Docker Images
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-backend
restore-keys: ${{ runner.os }}-maven-
- name: Build and Package on ${{ matrix.java }}
run: |
./mvnw -B clean install \
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-e2e
restore-keys: ${{ runner.os }}-maven-
- name: Build Image
run: |
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-e2e
restore-keys: ${{ runner.os }}-maven-
- uses: actions/download-artifact@v2
name: Download Docker Images
Expand Down Expand Up @@ -174,7 +174,7 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-e2e
restore-keys: ${{ runner.os }}-maven-
- uses: actions/download-artifact@v2
name: Download Docker Images
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/publish-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-docker
restore-keys: ${{ runner.os }}-maven-
- name: Set environment variables
run: |
if [[ ${{ github.event_name }} == "release" ]]; then
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-unit-test
restore-keys: ${{ runner.os }}-maven-

- name: Run Unit tests
run: ./mvnw clean verify -B -Dmaven.test.skip=false -Dspotless.skip=true
Expand Down

0 comments on commit 294a622

Please sign in to comment.