Skip to content

Commit

Permalink
Better caching key for continuous integration
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentRDC committed Oct 10, 2024
1 parent 37fc6d9 commit 8919ea3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,19 @@ jobs:
cabal update
cabal configure --disable-optimization --enable-tests
cabal freeze
# Exclude the timestamp of Hackage index update from our cache key, to
# avoid invalidating cache too often.
# This idea comes from 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 8919ea3

Please sign in to comment.