Skip to content

Commit 21f9269

Browse files
committed
Cache subdirectory target dirs in Wasm CI jobs (#5439)
## Motivation Fix #5433. The CI jobs `wasm-application-test` and `linera-sdk-tests-fixtures` are extremely slow (~13 min and ~6 min respectively), even on subsequent runs, because their subdirectory `target/` directories are not cached between CI runs. The root cause is that `actions-rust-lang/setup-rust-toolchain@v1` uses `Swatinem/rust-cache` under the hood, which [defaults to caching only `./target/`](https://github.com/Swatinem/rust-cache/blob/master/README.md). Since these jobs build in `examples/` and `linera-sdk/tests/fixtures/`, their `target/` directories are never persisted. ## Proposal Add the `cache-workspaces` parameter to the `setup-rust-toolchain` action in both jobs, pointing to the correct subdirectory target dirs: - `wasm-application-test`: `examples -> target` - `linera-sdk-tests-fixtures`: `linera-sdk/tests/fixtures -> target` ## Test Plan - The first CI run after merging will still be slow (cold cache). - The second run on the same branch showed around a 25% improvement, it seems ## Release Plan - Nothing to do / These changes follow the usual release cycle.
1 parent 7ae4e9f commit 21f9269

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.github/workflows/rust.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ jobs:
131131
steps:
132132
- uses: actions/checkout@v4
133133
- uses: actions-rust-lang/setup-rust-toolchain@v1
134+
with:
135+
cache-workspaces: |
136+
examples -> target
134137
- name: Install Protoc
135138
uses: arduino/setup-protoc@v3
136139
with:
@@ -149,6 +152,9 @@ jobs:
149152
steps:
150153
- uses: actions/checkout@v4
151154
- uses: actions-rust-lang/setup-rust-toolchain@v1
155+
with:
156+
cache-workspaces: |
157+
linera-sdk/tests/fixtures -> target
152158
- name: Install Protoc
153159
uses: arduino/setup-protoc@v3
154160
with:

0 commit comments

Comments
 (0)