Skip to content

Commit 1ae33b5

Browse files
committed
ci: Cache crates.io index
Significantly improves build speed for old versions. See slog-rs/slog@74b944d
1 parent 6c3d09a commit 1ae33b5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/test.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@ jobs:
4343
- uses: dtolnay/rust-toolchain@master
4444
with:
4545
toolchain: ${{ matrix.rust }}
46+
- name: Cache Cargo Registry
47+
id: cache-index
48+
uses: actions/cache@v4
49+
with:
50+
path:
51+
# Before the sparse index, updating the registry took forever
52+
~/.cargo/registry/index/
53+
key: ${{ runner.os }}-cargo-${{ matrix.rust }}
54+
restore-keys: |
55+
${{ runner.os }}-cargo-
4656
# NOTE: We only run `cargo test`. No need for a separate `cargo check`
4757
- name: Test
4858
run: |

0 commit comments

Comments
 (0)