From c7e5426cb69188fcf0c3adeed4cad47b83e18998 Mon Sep 17 00:00:00 2001 From: Anatolios Laskaris Date: Mon, 30 Oct 2023 11:45:19 +0200 Subject: [PATCH] chore: Separate cache for different arch (#1873) * Separate cache for different arch * Save in tests too * typo --- .github/workflows/build.yml | 2 +- .github/workflows/tests.yml | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 58635b442a..43b9fd28c1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,7 +77,7 @@ jobs: uses: Swatinem/rust-cache@v2 with: cache-directories: ~/.cache/sccache - shared-key: nox + shared-key: nox-${{ matrix.arch }} # github allows only 10GB of cache # so save cache only on merge to master # to use less space and speed up CI diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c3d341e27a..a1091a0915 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,8 +36,11 @@ jobs: uses: Swatinem/rust-cache@v2 with: cache-directories: ~/.cache/sccache - shared-key: nox - save-if: false + shared-key: nox-tests + # github allows only 10GB of cache + # so save cache only on merge to master + # to use less space and speed up CI + save-if: ${{ github.event_name == 'push' }} - name: Setup sccache uses: mozilla-actions/sccache-action@v0.0.3