From 952c536a3b6e63996849ca9b54d56ebfff825ed7 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Mon, 28 Aug 2023 22:29:28 -0700 Subject: [PATCH] Consider cargo config in granular cache key (#54700) x-ref: [slack thread](https://vercel.slack.com/archives/C04KC8A53T7/p1693270746110069) --- .github/workflows/build_and_deploy.yml | 2 +- .github/workflows/build_reusable.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index d02156a4f8b7f..22441f0baeecb 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -271,9 +271,9 @@ jobs: - name: Cache on ${{ github.ref_name }} uses: ijjk/rust-cache@turbo-cache-v1.0.7 with: - shared-key: build-${{ matrix.settings.target }} save-if: 'true' cache-provider: 'turbo' + shared-key: build-${{ matrix.settings.target }}-${{ hashFiles('.cargo/config.toml') }} # we only need custom caching for docker builds # as they are on an older Node.js version and have diff --git a/.github/workflows/build_reusable.yml b/.github/workflows/build_reusable.yml index 40102b1031581..cad4f7a34882d 100644 --- a/.github/workflows/build_reusable.yml +++ b/.github/workflows/build_reusable.yml @@ -122,9 +122,9 @@ jobs: uses: ijjk/rust-cache@turbo-cache-v1.0.7 if: ${{ inputs.rustCacheKey }} with: - shared-key: ${{ inputs.rustCacheKey }}-x86_64-unknown-linux-gnu - save-if: ${{ github.ref_name == 'canary' }} cache-provider: 'turbo' + save-if: ${{ github.ref_name == 'canary' }} + shared-key: ${{ inputs.rustCacheKey }}-x86_64-unknown-linux-gnu-build-${{ hashFiles('.cargo/config.toml') }} # clean up any previous artifacts to avoid hitting disk space limits - run: git clean -xdf && rm -rf /tmp/next-repo-*; rm -rf /tmp/next-install-* /tmp/yarn-* /tmp/ncc-cache target