Skip to content

Commit d8bc03f

Browse files
committed
ci: caching and cleanup
1 parent 160ad0d commit d8bc03f

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

.github/workflows/haskell.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,34 @@ jobs:
5050

5151
- name: Configure the build
5252
run: |
53-
cabal update
5453
cabal configure --enable-tests --enable-benchmarks --disable-documentation
5554
cabal build --dry-run
5655
56+
- name: Restore cached dependencies
57+
uses: actions/cache/restore@v4
58+
id: cache
59+
env:
60+
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
61+
with:
62+
path: ${{ steps.setup.outputs.cabal-store }}
63+
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
64+
restore-keys: ${{ env.key }}-
65+
5766
- name: Build dependencies
5867
run: cabal build --only-dependencies
5968

69+
- name: Save cached dependencies
70+
uses: actions/cache/save@v4
71+
if: steps.cache.outputs.cache-hit != 'true'
72+
with:
73+
path: ${{ steps.setup.outputs.cabal-store }}
74+
key: ${{ steps.cache.outputs.cache-primary-key }}
75+
6076
- name: Build the package
61-
run: cabal build
77+
run: cabal build all
6278

6379
- name: Run tests
64-
run: cabal test
80+
run: cabal test all
6581

6682
- name: Build documentation
67-
run: cabal haddock
83+
run: cabal haddock all

0 commit comments

Comments
 (0)