Skip to content

Commit

Permalink
CI: do not invalidate cache with every Hackage update (#996)
Browse files Browse the repository at this point in the history
  • Loading branch information
Minoru committed Aug 6, 2023
1 parent 388565c commit 416faa8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,15 @@ jobs:
run: |
cabal update
cabal freeze
# Exclude the timestamp of Hackage index update from our cache key, to
# avoid invalidating cache too often.
sed '/^index-state: /d' cabal.project.freeze > dependencies-versions
- uses: actions/cache@v3
name: Cache ~/.cabal/store
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies-versions') }}

- name: Build
run: |
Expand Down Expand Up @@ -124,12 +127,15 @@ jobs:
- name: Freeze
run: |
cabal freeze
# Exclude the timestamp of Hackage index update from our cache key, to
# avoid invalidating cache too often.
sed '/^index-state: /d' cabal.project.freeze > dependencies-versions
- uses: actions/cache@v3
name: Cache ~/.cabal/store
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies-versions') }}

- name: Prepare Cabal package
run: |
Expand Down

0 comments on commit 416faa8

Please sign in to comment.