Skip to content

Commit

Permalink
CI: better cache key, ignoring the index state timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentRDC committed Jan 29, 2025
1 parent 34b9fe0 commit c2dd9aa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,20 @@ jobs:
cabal update
cabal configure --disable-optimization --enable-tests --disable-benchmarks
cabal freeze
# Exclude the timestamp of Hackage index update from our cache key, to
# avoid invalidating cache too often.
# This idea comes from:
# https://github/com/jaspervdj/hakyll
sed '/^index-state: /d' cabal.project.freeze > dependencies-versions
- name: Cache cabal work
uses: actions/cache@v4
with:
path: |
dist-newstyle
${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ runner.os }}-${{ hashFiles('cabal.project.freeze', 'cabal.project.local') }}-cabal-install
key: ${{ runner.os }}-${{ hashFiles('dependencies-versions', 'cabal.project.local') }}-cabal-install

- name: Build dependencies
run: |
Expand Down

0 comments on commit c2dd9aa

Please sign in to comment.