From b01ab1baa55b239292a5864b76a5c638395c310d Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sun, 27 Dec 2020 21:15:02 +0000 Subject: [PATCH] add back cargo cache --- .github/workflows/linux.yml | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 2fc8b4d86..e8a1db0ff 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -30,6 +30,25 @@ jobs: profile: minimal override: true + - name: Generate Cargo.lock + uses: actions-rs/cargo@v1 + with: + command: generate-lockfile + - name: Cache cargo dirs + uses: actions/cache@v2 + with: + path: + ~/.cargo/registry + ~/.cargo/git + ~/.cargo/bin + key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-trimmed-${{ hashFiles('**/Cargo.lock') }} + + - name: Cache cargo build + uses: actions/cache@v2 + with: + path: target + key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-build-trimmed-${{ hashFiles('**/Cargo.lock') }} + - name: check build uses: actions-rs/cargo@v1 with: @@ -60,10 +79,18 @@ jobs: - name: Generate coverage file if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request') run: | - cargo install cargo-tarpaulin --vers "^0.13" - cargo tarpaulin --out Xml + cargo install cargo-tarpaulin + cargo tarpaulin --out Xml --workspace + - name: Upload to Codecov if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request') uses: codecov/codecov-action@v1 with: file: cobertura.xml + + - name: Clear the cargo caches + run: | + rustup update stable + rustup override set stable + cargo install cargo-cache --no-default-features --features ci-autoclean + cargo-cache