.github/workflows/ci.yml: Use swatinem/rust-cache (#2228)

This commit is contained in:
Denis Pisarev 2021-09-25 15:22:33 +02:00 committed by GitHub
parent e83e1b3d0b
commit 6f7a19e753
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,17 +19,7 @@ jobs:
- uses: actions/checkout@v2.3.4
- name: Cache CARGO_HOME
uses: actions/cache@v2.1.6
with:
path: ~/.cargo
key: cargo-home-${{ hashFiles('Cargo.toml') }}
- name: Cache cargo build
uses: actions/cache@v2.1.6
with:
path: target
key: cargo-build-target-${{ hashFiles('Cargo.toml') }}
- uses: Swatinem/rust-cache@v1.3.0
- name: Run tests, with no feature
run: cargo test --workspace --no-default-features
@ -72,25 +62,13 @@ jobs:
- name: Install a recent version of clang
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
echo "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main" >> /etc/apt/sources.list
apt-get update
apt-get install -y clang-11
- name: Install CMake
run: apt-get install -y cmake
- name: Cache CARGO_HOME
uses: actions/cache@v2.1.6
with:
path: ~/.cargo
key: cargo-home-${{ hashFiles('Cargo.toml') }}
- name: Cache cargo build
uses: actions/cache@v2.1.6
with:
path: target
key: wasm-cargo-build-target-${{ hashFiles('Cargo.toml') }}
- uses: Swatinem/rust-cache@v1.3.0
- name: Build on wasm32-unknown-emscripten
# TODO: also run `cargo test`
@ -137,17 +115,7 @@ jobs:
override: true
components: clippy
- name: Cache CARGO_HOME
uses: actions/cache@v2.1.6
with:
path: ~/.cargo
key: cargo-home-${{ hashFiles('Cargo.toml') }}
- name: Cache cargo build
uses: actions/cache@v2.1.6
with:
path: target
key: cargo-build-target-${{ hashFiles('Cargo.toml') }}
- uses: Swatinem/rust-cache@v1.3.0
- name: Run cargo clippy
uses: actions-rs/cargo@v1.0.3
@ -168,17 +136,7 @@ jobs:
- uses: actions/checkout@v2.3.4
- name: Cache CARGO_HOME
uses: actions/cache@v2.1.6
with:
path: ~/.cargo
key: cargo-home-${{ hashFiles('Cargo.toml') }}
- name: Cache cargo build
uses: actions/cache@v2.1.6
with:
path: target
key: cargo-build-target-${{ hashFiles('Cargo.toml') }}
- uses: Swatinem/rust-cache@v1.3.0
- name: Run ipfs-kad example
run: RUST_LOG=libp2p_swarm=debug,libp2p_kad=trace,libp2p_tcp=debug cargo run --example ipfs-kad