Skip to content

Commit 71536b9

Browse files
committed
Cache v2, disambiguate caches and install sweep after caching
1 parent a0b3cff commit 71536b9

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,28 @@ jobs:
1717
with:
1818
toolchain: stable
1919
override: true
20-
- uses: actions-rs/cargo@v1
21-
with:
22-
command: install
23-
args: cargo-sweep
2420

2521
- name: Cache directories
26-
uses: actions/cache@v1
22+
uses: actions/cache@v2
2723
with:
2824
path: |
2925
~/.cargo/registry
3026
~/.cargo/bin
3127
~/.cargo/git
32-
key: cargo-dirs-${{ hashFiles('**/Cargo.lock') }}
33-
restore-keys: cargo-dirs-
28+
key: cargo-test-dirs-${{ hashFiles('**/Cargo.lock') }}
29+
restore-keys: cargo-test-dirs-
3430
- name: Cache build
35-
uses: actions/cache@v1
31+
uses: actions/cache@v2
3632
with:
3733
path: target
38-
key: cargo-build-${{ steps.install.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}
34+
key: cargo-test-build-${{ steps.install.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}
3935
restore-keys: |
40-
cargo-build-${{ steps.install.outputs.rustc_hash }}-
41-
cargo-build-
36+
cargo-test-build-${{ steps.install.outputs.rustc_hash }}-
37+
cargo-test-build-
38+
- uses: actions-rs/cargo@v1
39+
with:
40+
command: install
41+
args: cargo-sweep
4242

4343
- name: Register artifacts
4444
uses: actions-rs/cargo@v1
@@ -102,28 +102,28 @@ jobs:
102102
toolchain: stable
103103
override: true
104104
components: clippy
105-
- uses: actions-rs/cargo@v1
106-
with:
107-
command: install
108-
args: cargo-sweep
109105

110106
- name: Cache directories
111-
uses: actions/cache@v1
107+
uses: actions/cache@v2
112108
with:
113109
path: |
114110
~/.cargo/registry
115111
~/.cargo/bin
116112
~/.cargo/git
117-
key: cargo-dirs-${{ hashFiles('**/Cargo.lock') }}
118-
restore-keys: cargo-dirs-
113+
key: cargo-clippy-dirs-${{ hashFiles('**/Cargo.lock') }}
114+
restore-keys: cargo-clippy-dirs-
119115
- name: Cache build
120-
uses: actions/cache@v1
116+
uses: actions/cache@v2
121117
with:
122118
path: target
123-
key: cargo-build-${{ steps.install.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}
119+
key: cargo-clippy-${{ steps.install.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}
124120
restore-keys: |
125-
cargo-build-${{ steps.install.outputs.rustc_hash }}-
126-
cargo-build-
121+
cargo-clippy-${{ steps.install.outputs.rustc_hash }}-
122+
cargo-clippy-
123+
- uses: actions-rs/cargo@v1
124+
with:
125+
command: install
126+
args: cargo-sweep
127127

128128
- name: Register artifacts
129129
uses: actions-rs/cargo@v1

.github/workflows/deps.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ jobs:
1818
with:
1919
toolchain: stable
2020
override: true
21-
- uses: actions-rs/cargo@v1
22-
with:
23-
command: install
24-
args: cargo-sweep
2521

2622
- name: Cache directories
2723
uses: actions/cache@v1
@@ -30,16 +26,20 @@ jobs:
3026
~/.cargo/registry
3127
~/.cargo/bin
3228
~/.cargo/git
33-
key: cargo-dirs-${{ hashFiles('**/Cargo.lock') }}
34-
restore-keys: cargo-dirs-
29+
key: cargo-deps-dirs-${{ hashFiles('**/Cargo.lock') }}
30+
restore-keys: cargo-deps-dirs-
3531
- name: Cache build
3632
uses: actions/cache@v1
3733
with:
3834
path: target
3935
key: cargo-build-${{ steps.install.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}
4036
restore-keys: |
41-
cargo-build-${{ steps.install.outputs.rustc_hash }}-
42-
cargo-build-
37+
cargo-deps-build-${{ steps.install.outputs.rustc_hash }}-
38+
cargo-deps-build-
39+
- uses: actions-rs/cargo@v1
40+
with:
41+
command: install
42+
args: cargo-sweep
4343

4444
- name: Register artifacts
4545
uses: actions-rs/cargo@v1

0 commit comments

Comments
 (0)