Skip to content

Commit 6d4241b

Browse files
authored
fix(cache): Cache hitting for Cabal build (#88)
1 parent 4b5ebca commit 6d4241b

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

.github/workflows/main.yml

+9-7
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
name: CI
77

8-
on:
9-
pull_request:
8+
on:
9+
pull_request:
1010
branches:
1111
- main
1212
push:
@@ -20,7 +20,7 @@ concurrency:
2020
jobs:
2121
generate-matrix:
2222
name: "Generate matrix from cabal"
23-
outputs:
23+
outputs:
2424
matrix: ${{ steps.set-matrix.outputs.matrix }}
2525
runs-on: ubuntu-latest
2626
steps:
@@ -46,21 +46,23 @@ jobs:
4646
id: setup
4747
with:
4848
ghc-version: ${{ matrix.ghc }}
49-
cabal-version: 'latest'
49+
cabal-version: "latest"
5050
cabal-update: true
5151
- name: Configure the build
5252
run: |
53-
cabal configure --enable-tests --disable-documentation
53+
cabal configure --enable-tests --enable-benchmarks --disable-documentation
5454
cabal build all --dry-run
55+
5556
- name: Restore cached dependencies
5657
uses: actions/cache/restore@v4
5758
id: cache
5859
env:
5960
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
6061
with:
6162
path: ${{ steps.setup.outputs.cabal-store }}
62-
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
63-
restore-keys: ${{ env.key }}-
63+
key: v1-${{ env.key }}-plan-${{ hashFiles('**/dist-newstyle/cache/plan.json') }}
64+
restore-keys: v1-ghc-deps-${{ env.key }}-
65+
6466
- name: Install dependencies
6567
if: steps.cache.outputs.cache-hit != 'true'
6668
run: cabal build all --only-dependencies

0 commit comments

Comments
 (0)