Skip to content

Commit 29e11e5

Browse files
committed
Add cargo caching
1 parent cddbd44 commit 29e11e5

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/ci.yml

+25
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,31 @@ jobs:
2929
toolchain: nightly
3030
override: true
3131

32+
# Cache Cargo dependencies
33+
- name: Cache Cargo registry
34+
uses: actions/cache@v3
35+
with:
36+
path: ~/.cargo/registry
37+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
38+
restore-keys: |
39+
${{ runner.os }}-cargo-registry-
40+
41+
- name: Cache Cargo index
42+
uses: actions/cache@v3
43+
with:
44+
path: ~/.cargo/git
45+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
46+
restore-keys: |
47+
${{ runner.os }}-cargo-index-
48+
49+
- name: Cache target directory
50+
uses: actions/cache@v3
51+
with:
52+
path: target
53+
key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.lock') }}
54+
restore-keys: |
55+
${{ runner.os }}-cargo-target-
56+
3257
# Install Rust dependencies
3358
- name: Install dependencies
3459
run: cargo fetch

0 commit comments

Comments
 (0)