Skip to content

Commit d54e96a

Browse files
committed
feat(ci): Add caching
1 parent cae4283 commit d54e96a

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/build.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ jobs:
3434
components: clippy,rustfmt
3535
toolchain: ${{ matrix.rust-version }}
3636

37+
- name: "Restore cached Cargo"
38+
id: cache-restore
39+
uses: actions/cache/restore@v4
40+
with:
41+
path: |
42+
~/.cargo/bin/
43+
~/.cargo/registry/index/
44+
~/.cargo/registry/cache/
45+
~/.cargo/git/db/
46+
target/
47+
key: ${{ runner.os }}-${{ matrix.rust-version }}-cargo
48+
3749
- name: "Formatting Check"
3850
run: cargo fmt --check
3951

@@ -44,4 +56,16 @@ jobs:
4456
cargo build --workspace
4557
cargo test --workspace
4658
59+
- name: Save Cargo / Rust Cache
60+
id: cache-save
61+
if: ${{ github.event_name == 'push' }}
62+
uses: actions/cache/save@v4
63+
with:
64+
path: |
65+
~/.cargo/bin/
66+
~/.cargo/registry/index/
67+
~/.cargo/registry/cache/
68+
~/.cargo/git/db/
69+
target/
70+
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
4771

0 commit comments

Comments
 (0)