Skip to content

Commit 539e2fa

Browse files
committed
ci: properly cache everything
1 parent 4078bb1 commit 539e2fa

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/main.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,20 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v2
14-
- name: Cache cargo
14+
15+
- name: Detect the installed Rust version
16+
id: rustc
17+
run: echo "::set-output name=version::$(rustc -V)"
18+
19+
- name: Cache Cargo's target directory
1520
uses: actions/cache@v2
1621
with:
1722
path: target
18-
key: cargo-build-${{ hashFiles('**/Cargo.lock') }}
23+
key: cargo-build-${{ steps.rustc.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('src/**') }}
1924
restore-keys: |
20-
cargo-build-
25+
cargo-build-${{ steps.rustc.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}-
26+
cargo-build-${{ steps.rustc.outputs.version }}-
27+
2128
- run: cargo run
2229
- run: cp CNAME ./site/
2330
- run: touch site/.nojekyll

0 commit comments

Comments
 (0)