Skip to content

Commit 6f7a19e

Browse files
authored
.github/workflows/ci.yml: Use swatinem/rust-cache (#2228)
1 parent e83e1b3 commit 6f7a19e

File tree

1 file changed

+4
-46
lines changed

1 file changed

+4
-46
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,7 @@ jobs:
1919

2020
- uses: actions/checkout@v2.3.4
2121

22-
- name: Cache CARGO_HOME
23-
uses: actions/cache@v2.1.6
24-
with:
25-
path: ~/.cargo
26-
key: cargo-home-${{ hashFiles('Cargo.toml') }}
27-
28-
- name: Cache cargo build
29-
uses: actions/cache@v2.1.6
30-
with:
31-
path: target
32-
key: cargo-build-target-${{ hashFiles('Cargo.toml') }}
22+
- uses: Swatinem/rust-cache@v1.3.0
3323

3424
- name: Run tests, with no feature
3525
run: cargo test --workspace --no-default-features
@@ -72,25 +62,13 @@ jobs:
7262

7363
- name: Install a recent version of clang
7464
run: |
75-
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
76-
echo "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main" >> /etc/apt/sources.list
7765
apt-get update
7866
apt-get install -y clang-11
7967
8068
- name: Install CMake
8169
run: apt-get install -y cmake
8270

83-
- name: Cache CARGO_HOME
84-
uses: actions/cache@v2.1.6
85-
with:
86-
path: ~/.cargo
87-
key: cargo-home-${{ hashFiles('Cargo.toml') }}
88-
89-
- name: Cache cargo build
90-
uses: actions/cache@v2.1.6
91-
with:
92-
path: target
93-
key: wasm-cargo-build-target-${{ hashFiles('Cargo.toml') }}
71+
- uses: Swatinem/rust-cache@v1.3.0
9472

9573
- name: Build on wasm32-unknown-emscripten
9674
# TODO: also run `cargo test`
@@ -137,17 +115,7 @@ jobs:
137115
override: true
138116
components: clippy
139117

140-
- name: Cache CARGO_HOME
141-
uses: actions/cache@v2.1.6
142-
with:
143-
path: ~/.cargo
144-
key: cargo-home-${{ hashFiles('Cargo.toml') }}
145-
146-
- name: Cache cargo build
147-
uses: actions/cache@v2.1.6
148-
with:
149-
path: target
150-
key: cargo-build-target-${{ hashFiles('Cargo.toml') }}
118+
- uses: Swatinem/rust-cache@v1.3.0
151119

152120
- name: Run cargo clippy
153121
uses: actions-rs/cargo@v1.0.3
@@ -168,17 +136,7 @@ jobs:
168136

169137
- uses: actions/checkout@v2.3.4
170138

171-
- name: Cache CARGO_HOME
172-
uses: actions/cache@v2.1.6
173-
with:
174-
path: ~/.cargo
175-
key: cargo-home-${{ hashFiles('Cargo.toml') }}
176-
177-
- name: Cache cargo build
178-
uses: actions/cache@v2.1.6
179-
with:
180-
path: target
181-
key: cargo-build-target-${{ hashFiles('Cargo.toml') }}
139+
- uses: Swatinem/rust-cache@v1.3.0
182140

183141
- name: Run ipfs-kad example
184142
run: RUST_LOG=libp2p_swarm=debug,libp2p_kad=trace,libp2p_tcp=debug cargo run --example ipfs-kad

0 commit comments

Comments
 (0)