From a3b5c13b52886568325b64e738754a4aa3a43846 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Wed, 17 Feb 2021 14:50:44 +1100 Subject: [PATCH] Upgrade to actions/cache@v2.1.4 Usually, we can follow the rolling major tag (@v2) of actions. However the recent release (2.1.4) is not yet included. See https://github.com/actions/cache/issues/528 for more details. We do want to depend on 2.1.4 because it contains a fix that allows us to use the cache action MacOS. v2 also features better compression and allows for multiple paths to be specified. --- .github/workflows/ci.yml | 52 +++++++++++++++------------------------- 1 file changed, 19 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 32477390..4fbff08b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: components: rustfmt, clippy - name: Cache ~/.cargo/bin directory - uses: actions/cache@v1 + uses: actions/cache@v2.1.4 with: path: ~/.cargo/bin key: ubuntu-rust-${{ env.RUST_TOOLCHAIN }}-cargo-bin-directory-v1 @@ -67,18 +67,13 @@ jobs: profile: minimal override: true - - name: Cache target directory - uses: actions/cache@v1 - if: matrix.os == 'ubuntu-latest' + - name: Cache target and registry directory + uses: actions/cache@v2.1.4 with: - path: target - key: rust-${{ matrix.target }}-target-directory-build-${{ hashFiles('Cargo.lock') }}-v1 - - - name: Cache ~/.cargo/registry directory - uses: actions/cache@v1 - with: - path: ~/.cargo/registry - key: rust-${{ matrix.target }}-cargo-registry-directory-${{ hashFiles('Cargo.lock') }}-v1 + path: | + target + ~/.cargo/registry + key: rust-${{ matrix.target }}-build-${{ hashFiles('Cargo.lock') }}-v1 - name: Build binary run: | @@ -119,18 +114,13 @@ jobs: profile: minimal override: true - - name: Cache target directory - uses: actions/cache@v1 - if: matrix.os == 'ubuntu-latest' + - name: Cache target and registry directory + uses: actions/cache@v2.1.4 with: - path: target - key: rust-${{ matrix.target }}-target-directory-test-${{ hashFiles('Cargo.lock') }}-v1 - - - name: Cache ~/.cargo/registry directory - uses: actions/cache@v1 - with: - path: ~/.cargo/registry - key: rust-${{ matrix.target }}-cargo-registry-directory-${{ hashFiles('Cargo.lock') }}-v1 + path: | + target + ~/.cargo/registry + key: rust-${{ matrix.target }}-test-${{ hashFiles('Cargo.lock') }}-v1 - name: Build tests run: cargo build --tests --workspace --all-features @@ -166,17 +156,13 @@ jobs: profile: minimal override: true - - name: Cache target directory - uses: actions/cache@v1 + - name: Cache target and registry directory + uses: actions/cache@v2.1.4 with: - path: target - key: rust-${{ matrix.target }}-target-directory-test-${{ hashFiles('Cargo.lock') }}-v1 - - - name: Cache ~/.cargo/registry directory - uses: actions/cache@v1 - with: - path: ~/.cargo/registry - key: rust-${{ env.TARGET }}-cargo-registry-directory-${{ hashFiles('Cargo.lock') }}-v1 + path: | + target + ~/.cargo/registry + key: rust-${{ matrix.target }}-test-${{ hashFiles('Cargo.lock') }}-v1 - name: Run test ${{ matrix.test_name }} run: cargo test --package swap --all-features --test ${{ matrix.test_name }} ""