From 119105d3071c735edd0a0a603cd09671e6152bb3 Mon Sep 17 00:00:00 2001 From: Alekos Filini Date: Thu, 19 Nov 2020 14:05:59 +0100 Subject: [PATCH] Generate a different cache key for every test --- .github/workflows/ci.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1a4d0dc7..2f3313a4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,13 +8,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: Generate cache key + run: echo "${{ matrix.channel }} ${{ matrix.features }}" | tee .cache_key - uses: actions/cache@v2 with: path: | ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -33,13 +35,15 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v2 + - name: Generate cache key + run: echo "${{ matrix.channel }} ${{ matrix.target }} ${{ matrix.features }}" | tee .cache_key - uses: actions/cache@v2 with: path: | ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -65,13 +69,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: Generate cache key + run: echo "${{ matrix.channel }} ${{ matrix.target }} ${{ matrix.features }}" | tee .cache_key - uses: actions/cache@v2 with: path: | ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -99,13 +105,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: Generate cache key + run: echo "${{ matrix.channel }} ${{ matrix.target }} ${{ matrix.features }}" | tee .cache_key - uses: actions/cache@v2 with: path: | ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} - uses: actions-rs/toolchain@v1 with: profile: minimal