Skip to content

Commit 99e2553

Browse files
committed
ci: add caching to rust test
1 parent 60aaeae commit 99e2553

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,29 @@ runs:
2121
with:
2222
tool: nextest,cargo-hack
2323

24+
- name: Cache Cargo registry 🔧
25+
uses: actions/cache@v3
26+
with:
27+
path: ~/.cargo/registry
28+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
29+
restore-keys: |
30+
${{ runner.os }}-cargo-registry-
31+
32+
- name: Cache Cargo index 🔧
33+
uses: actions/cache@v3
34+
with:
35+
path: ~/.cargo/git
36+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
37+
restore-keys: |
38+
${{ runner.os }}-cargo-index-
39+
40+
- name: Cache Cargo build 🔧
41+
uses: actions/cache@v3
42+
with:
43+
path: ${{ inputs.target-folder }}
44+
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
45+
restore-keys: |
46+
2447
- name: Check formatting
2548
working-directory: ${{ inputs.working-directory }}
2649
run: cargo fmt --check ${{ inputs.additional-flags }}

0 commit comments

Comments
 (0)