Commit 21f9269
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
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
134 | 137 | | |
135 | 138 | | |
136 | 139 | | |
| |||
149 | 152 | | |
150 | 153 | | |
151 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
152 | 158 | | |
153 | 159 | | |
154 | 160 | | |
| |||
0 commit comments