Skip to content

Commit ee10d42

Browse files
committed
ci: Cache Rust compilation and cargo dependencies
I noticed that Wasmtime uses almost no cache for its GitHub Actions workflows. Let's see how well adding a cache for `target` plus various `cargo` dirs works.
1 parent 136500e commit ee10d42

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/actions/install-rust/action.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,15 @@ runs:
7474
- name: Install the WASI target
7575
shell: bash
7676
run: rustup target add wasm32-wasip1 wasm32-unknown-unknown
77+
78+
- name: Set up cargo cache
79+
uses: actions/cache@v4
80+
with:
81+
path: |
82+
~/.cargo/bin/
83+
~/.cargo/registry/index/
84+
~/.cargo/registry/cache/
85+
~/.cargo/git/db/
86+
target/
87+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
88+
restore-keys: ${{ runner.os }}-cargo-

0 commit comments

Comments
 (0)