From b570a10a3e1bf127d75171cae1663c861a77e9c4 Mon Sep 17 00:00:00 2001 From: brandon s allbery kf8nh Date: Thu, 12 Mar 2026 17:59:26 -0400 Subject: [PATCH] use hash instead of date in bootstrap cache keys Without some distinct identifier, downloaded sources will accumulate (and have been since the last time the datestamp was updated). The old caches are ignored and will be purged according to GitHub's cache expiration, because otherwise we'd continue to carry 4 years' worth of outdated source tarballs. --- .github/workflows/bootstrap.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 5527e3ea4c8..a9fdbd6d540 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -32,6 +32,8 @@ jobs: rm -rf ~/.config/cabal rm -rf ~/.cache/cabal + - uses: actions/checkout@v6 + # runner.os isn't sufficient for binary compatible caches - name: Get runner OS/version for cache keys id: get-osver @@ -42,10 +44,9 @@ jobs: id: bootstrap-cache with: path: "/home/runner/work/cabal/cabal/_build" - key: bootstrap-${{ steps.get-osver.outputs.osver }}-${{ matrix.ghc }}-20221115-${{ github.sha }} - restore-keys: bootstrap-${{ steps.get-osver.outputs.osver }}-${{ matrix.ghc }}-20221115- + key: bootstrap-${{ steps.get-osver.outputs.osver }}-${{ matrix.ghc }}-${{ hashFiles(format('bootstrap/linux-{0}.json', matrix.ghc)) }}-${{ github.sha }} + restore-keys: bootstrap-${{ steps.get-osver.outputs.osver }}-${{ matrix.ghc }}-${{ hashFiles(format('bootstrap/linux-{0}.json', matrix.ghc)) }}- - - uses: actions/checkout@v6 - uses: haskell-actions/setup@v2 with: ghc-version: ${{ matrix.ghc }}