@@ -22,11 +22,11 @@ jobs:
2222 strategy :
2323 matrix :
2424 os : [ubuntu-latest] # macOS-latest, windows-latest
25- cabal : [3.10.3 ]
26- deploy-ghc : [9.6.6 ]
27- ghc : [9.4.8 , 9.6.6 , 9.8.2 , 9.10.1 ]
25+ cabal : [3.14.2.0 ]
26+ deploy-ghc : [9.6.7 ]
27+ ghc : [9.6.7 , 9.8.4 , 9.10.3 , 9.12.2 ]
2828 steps :
29- - uses : actions/checkout@v3
29+ - uses : actions/checkout@v6
3030 if : github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
3131
3232 # Takes care of ghc and cabal. See https://github.com/haskell/actions.
@@ -37,11 +37,20 @@ jobs:
3737 ghc-version : ${{ matrix.ghc }}
3838 cabal-version : ${{ matrix.cabal }}
3939
40- # Generate a cabal.project.freeze file with all dependencies. We use the
41- # hash of this as the cache key, so when a dependency changes we upload a
42- # new cache.
43- - name : Freeze
44- run : cabal freeze
40+ # Andreas, 2025-11-28: Since the freeze file contains a timestamp of the Hackage index
41+ # and the index changes several times a day,
42+ # the freeze file is not very useful as a cache key.
43+ # Instead, use the plan.json file (see below).
44+ # # Generate a cabal.project.freeze file with all dependencies. We use the
45+ # # hash of this as the cache key, so when a dependency changes we upload a
46+ # # new cache.
47+ # - name: Freeze
48+ # run: cabal freeze
49+
50+ - name : Configure the build plan
51+ run : |
52+ cabal build --dry-run
53+ # cabal build --dry-run creates dist-newstyle/cache/plan.json
4554
4655 # Install fix-whitespace since we need it for tests.
4756 # This is done after the freeze to make sure we re-use the packages
@@ -54,11 +63,14 @@ jobs:
5463 # every build. `restore-keys` makes it use the latest cache even if the
5564 # fingerprint doesn't match, so we don't need to start from scratch every
5665 # time a dependency changes.
57- - uses : actions/cache@v3
58- name : Cache ~/.cabal/store
66+ - uses : actions/cache/restore@v4
67+ name : Restore cached ~/.cabal/store
68+ id : cache
5969 with :
6070 path : ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
61- key : ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
71+ # The freeze file is a bad key, use dist-newstyle/cache/plan.json instead.
72+ # key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
73+ key : ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('**/plan.json') }}
6274 restore-keys : ${{ runner.os }}-${{ matrix.ghc }}-
6375
6476 - name : Run test suite
7082
7183 - name : Deploy Prelude HTML
7284 if : ${{ (matrix.ghc == matrix.deploy-ghc) && (github.ref == 'refs/heads/master') }}
73- uses : peaceiris/actions-gh-pages@v3
85+ uses : peaceiris/actions-gh-pages@v4
7486 with :
7587 github_token : ${{ secrets.GITHUB_TOKEN }}
7688 publish_dir : html
7789 destination_dir : lib
7890
91+ - uses : actions/cache/save@v4
92+ name : Cache ~/.cabal/store
93+ if : always() && steps.cache.outputs.cache-hit != 'true'
94+ with :
95+ path : ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
96+ key : ${{ steps.cache.outputs.cache-primary-key }}
0 commit comments