From 0edcc83c137fbf6c06ec715ff1ee80f1a79b3cac Mon Sep 17 00:00:00 2001 From: Alekos Filini Date: Thu, 19 Nov 2020 12:20:49 +0100 Subject: [PATCH] [ci] Generate a different cache key for every job --- .github/workflows/cont_integration.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml index fa4430b5..e13718ea 100644 --- a/.github/workflows/cont_integration.yml +++ b/.github/workflows/cont_integration.yml @@ -32,6 +32,8 @@ jobs: steps: - name: checkout uses: actions/checkout@v2 + - name: Generate cache key + run: echo "${{ matrix.rust }} ${{ matrix.features }}" | tee .cache_key - name: cache uses: actions/cache@v2 with: @@ -39,7 +41,7 @@ jobs: ~/.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') }} - name: Set default toolchain run: rustup default ${{ matrix.rust }} - name: Set profile @@ -75,7 +77,7 @@ jobs: ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-${{ github.job }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} - name: Install rustup run: curl https://sh.rustup.rs -sSf | sh -s -- -y - name: Set default toolchain @@ -103,7 +105,7 @@ jobs: ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-${{ github.job }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} # Install a recent version of clang that supports wasm32 - run: wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - || exit 1 - run: sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-10 main" || exit 1 @@ -131,4 +133,4 @@ jobs: - name: Add clippy run: rustup component add rustfmt - name: Check fmt - run: cargo fmt --all -- --check \ No newline at end of file + run: cargo fmt --all -- --check