From fbaca1ed7ece82dbbf4e5a0f444f0151746f0604 Mon Sep 17 00:00:00 2001 From: "Rune K. Svendsen" Date: Mon, 13 Jan 2025 08:04:53 +0100 Subject: [PATCH] CI: don't share cache between C compilers The "Cache cabal files"-step would restore a cache from a key that does not include the C compiler, which means e.g. Clang could restore stuff built by GCC. Also, the `restore-keys` key didn't even include the GHC version. This meant that -- in case of a cache miss for `key` -- a cache built by one GHC version could be pulled for a CI run for another GHC version. --- .github/workflows/cabal-in-nix-shell.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cabal-in-nix-shell.yml b/.github/workflows/cabal-in-nix-shell.yml index 18c4829..8c7a75f 100644 --- a/.github/workflows/cabal-in-nix-shell.yml +++ b/.github/workflows/cabal-in-nix-shell.yml @@ -42,8 +42,8 @@ jobs: ~/.cabal/packages ~/.cabal/store dist-newstyle - key: ${{ runner.os }}-${{ matrix.os }}-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.freeze') }}--${{ matrix.ghc }} - restore-keys: ${{ runner.os }}-${{ matrix.os }}- + key: ${{ runner.os }}-${{ matrix.os }}-${{ matrix.ghc }}-${{ matrix.cc }}-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.freeze') }} + restore-keys: ${{ runner.os }}-${{ matrix.os }}-${{ matrix.ghc }}-${{ matrix.cc }}- # Make nix-shell use specific Bash version. # Cf. https://nixos.org/manual/nix/stable/command-ref/nix-shell#environment-variables.