Skip to content

Commit 8919ea3

Browse files
committed
Better caching key for continuous integration
1 parent 37fc6d9 commit 8919ea3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/build.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,19 @@ jobs:
3636
cabal update
3737
cabal configure --disable-optimization --enable-tests
3838
cabal freeze
39+
40+
# Exclude the timestamp of Hackage index update from our cache key, to
41+
# avoid invalidating cache too often.
42+
# This idea comes from github.com/jaspervdj/hakyll
43+
sed '/^index-state: /d' cabal.project.freeze > dependencies-versions
3944
4045
- name: Cache cabal work
4146
uses: actions/cache@v4
4247
with:
4348
path: |
4449
dist-newstyle
4550
${{ steps.setup-haskell.outputs.cabal-store }}
46-
key: ${{ runner.os }}-${{ hashFiles('cabal.project.freeze', 'cabal.project.local') }}-cabal-install
51+
key: ${{ runner.os }}-${{ hashFiles('dependencies-versions', 'cabal.project.local') }}-cabal-install
4752

4853
- name: Build dependencies
4954
run: |

0 commit comments

Comments
 (0)