From 6f7a19e7533e6469a473ca8e6234a9adc5a8b0f6 Mon Sep 17 00:00:00 2001 From: Denis Pisarev Date: Sat, 25 Sep 2021 15:22:33 +0200 Subject: [PATCH] .github/workflows/ci.yml: Use swatinem/rust-cache (#2228) --- .github/workflows/ci.yml | 50 ++++------------------------------------ 1 file changed, 4 insertions(+), 46 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 544f844e..d4148477 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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