Skip to content

Commit bdcf751

Browse files
authored
Update Github Actions for better caching
The current cache key did not use `cabal.project.freeze` nor refer to the GHC version, which led to lots of rebuilds
1 parent e5e68c8 commit bdcf751

1 file changed

Lines changed: 4 additions & 14 deletions

File tree

.github/workflows/cabal.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,14 @@ jobs:
2222
matrix:
2323
include:
2424
- ghc-version: "8.10.7"
25-
cabal-flags: ""
2625
- ghc-version: "9.0.2"
27-
cabal-flags: ""
2826
- ghc-version: "9.2.8"
29-
cabal-flags: ""
3027
- ghc-version: "9.4.8"
31-
cabal-flags: ""
3228
- ghc-version: "9.6.7"
33-
cabal-flags: ""
3429
- ghc-version: "9.8.4"
35-
cabal-flags: ""
3630
- ghc-version: "9.10.3"
37-
cabal-flags: ""
3831
- ghc-version: "9.12.2"
39-
cabal-flags: ""
4032
- ghc-version: "9.14.1"
41-
# See issue 479 for when we can drop the following flags
42-
cabal-flags: "--allow-newer=base --allow-newer=ghc-bignum --allow-newer=containers --allow-newer=template-haskell"
4333

4434
runs-on: "ubuntu-latest"
4535

@@ -57,7 +47,7 @@ jobs:
5747
run: |
5848
# Cloud Haskell tests using the QUIC backend are quite flaky, but in CI only.
5949
# Therefore, the 'quic' flag is normally enabled locally, but disabled in CI.
60-
cabal configure --test-show-details=direct --flags "-quic" ${{matrix.cabal-flags}}
50+
cabal configure --test-show-details=direct --flags "-quic"
6151
cabal freeze --minimize-conflict-set
6252
cat cabal.project.freeze
6353
@@ -67,9 +57,9 @@ jobs:
6757
path: |
6858
dist-newstyle
6959
${{ steps.setup-haskell.outputs.cabal-store }}
70-
# We are using the hash of 'cabal.project.local' so that different levels
71-
# of optimizations are cached separately
72-
key: ${{ runner.os }}-${{ hashFiles('cabal.project', 'cabal.project.local') }}-cabal-install
60+
key: ${{ runner.os }}-ghc-${{ matrix.ghc-version }}-${{ hashFiles('cabal.project', 'cabal.project.freeze') }}
61+
restore-keys: |
62+
${{ runner.os }}-ghc-${{ matrix.ghc-version }}-
7363
7464
- name: Build dependencies only
7565
run: cabal build all --only-dependencies

0 commit comments

Comments
 (0)