Skip to content

Commit 14a88ce

Browse files
committed
Cache "cargo install"
Signed-off-by: Joe Richey <[email protected]>
1 parent 1274788 commit 14a88ce

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

.github/workflows/tests.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,16 @@ jobs:
2424
profile: minimal
2525
toolchain: nightly
2626
override: true
27-
- run: cargo install cargo-deadlinks
27+
# Use actions-rs/install after https://github.com/actions-rs/tool-cache/pull/20 is merged
28+
- name: Cache deadlinks
29+
id: cache-deadlinks
30+
uses: actions/cache@v1
31+
with:
32+
path: ~/.cargo/bin/
33+
key: ${{ runner.os }}-deadlinks
34+
- name: Install deadlinks
35+
if: steps.cache-deadlinks.outputs.cache-hit != 'true'
36+
run: cargo install cargo-deadlinks
2837
- run: cargo deadlinks -- --features=custom,std
2938
- run: cargo generate-lockfile -Z minimal-versions && cargo test
3039

@@ -105,20 +114,12 @@ jobs:
105114
toolchain: stable
106115
steps:
107116
- uses: actions/checkout@v2
108-
- name: Install toolchain
109-
uses: actions-rs/toolchain@v1
110-
with:
111-
profile: minimal
112-
target: ${{ matrix.target }}
113-
toolchain: ${{ matrix.toolchain }}
114-
override: true
115-
- name: Cache cargo plugins
116-
uses: actions/cache@v1
117-
with:
118-
path: ~/.cargo/bin/
119-
key: ${{ runner.os }}-cargo-plugins
120117
- name: Install cross
121-
run: cargo install cross || true
118+
uses: actions-rs/[email protected]
119+
with:
120+
crate: cross
121+
version: latest
122+
use-tool-cache: true
122123
- name: Test
123124
run: cross test --no-fail-fast --target=${{ matrix.target }} --features=custom,std
124125

0 commit comments

Comments
 (0)