Skip to content

Commit def4546

Browse files
committed
ci: reuse rust-cache between different jobs on the same platform
1 parent de88135 commit def4546

1 file changed

Lines changed: 18 additions & 15 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ jobs:
4444
run: echo "TARGET=$(rustc --print host-tuple)" >> "$GITHUB_ENV"
4545
- uses: Swatinem/rust-cache@v2
4646
with:
47-
workspaces: |
48-
.
49-
tests/difftests/tests
47+
add-job-id-key: "false"
48+
shared-key: "base"
5049
# Fetch dependencies in a separate step to clearly show how long each part
5150
# of the testing takes
5251
- name: cargo fetch --locked
@@ -105,9 +104,8 @@ jobs:
105104
run: cargo version
106105
- uses: Swatinem/rust-cache@v2
107106
with:
108-
workspaces: |
109-
.
110-
tests/difftests/tests
107+
add-job-id-key: "false"
108+
shared-key: "android"
111109
- name: cargo fetch --locked
112110
run: cargo fetch --locked --target ${{ matrix.target }}
113111

@@ -154,9 +152,9 @@ jobs:
154152
run: echo "TARGET=$(rustc --print host-tuple)" >> "$GITHUB_ENV"
155153
- uses: Swatinem/rust-cache@v2
156154
with:
157-
workspaces: |
158-
.
159-
tests/difftests/tests
155+
add-job-id-key: "false"
156+
shared-key: "base"
157+
save-if: "false"
160158
- name: cargo fetch --locked
161159
run: cargo fetch --locked --target $TARGET
162160
- name: compiletest
@@ -194,9 +192,14 @@ jobs:
194192
run: echo "TARGET=$(rustc --print host-tuple)" >> "$GITHUB_ENV"
195193
- uses: Swatinem/rust-cache@v2
196194
with:
197-
workspaces: |
198-
.
199-
tests/difftests/tests
195+
add-job-id-key: "false"
196+
shared-key: "base"
197+
save-if: "false"
198+
- uses: Swatinem/rust-cache@v2
199+
with:
200+
add-job-id-key: "false"
201+
shared-key: "difftest"
202+
workspaces: "tests/difftests/tests"
200203
- name: cargo fetch --locked
201204
run: cargo fetch --locked --target $TARGET
202205
- name: cargo fetch --locked difftests
@@ -248,9 +251,9 @@ jobs:
248251
run: cargo version
249252
- uses: Swatinem/rust-cache@v2
250253
with:
251-
workspaces: |
252-
.
253-
tests/difftests/tests
254+
add-job-id-key: "false"
255+
shared-key: "base"
256+
save-if: "false"
254257
- name: Install rustup components
255258
run: rustup component add rustfmt clippy
256259
- name: cargo fetch --locked

0 commit comments

Comments
 (0)