11---
2- name : cabal -build
2+ name : stack -build
33on :
44 push :
55 branches : main
@@ -11,40 +11,49 @@ permissions:
1111
1212jobs :
1313 build :
14- name : ${{ matrix.os }} / ghc ${{ matrix.ghc-version }}
14+ name : LTS ${{ matrix.stack.lts }} / ghc- ${{ matrix.stack. ghc }} / ${{ matrix.os }}
1515 runs-on : ${{ matrix.os }}-latest
1616 strategy :
1717 fail-fast : false
1818 matrix :
1919 os : [ubuntu]
20- ghc-version :
21- - 9.8
22- - 9.6
23- - 9.4
20+ stack :
21+ - lts : 23.28
22+ ghc : 9.8.4
23+
24+ - lts : 22.44
25+ ghc : 9.6.7
26+
27+ - lts : 21.25
28+ ghc : 9.4.8
2429
2530 include :
2631 - os : windows
27- ghc-version : 9.6
32+ stack :
33+ lts : 21.25
34+ ghc : 9.8.4
2835
2936 - os : macos
30- ghc-version : 9.6
37+ stack :
38+ lts : 21.25
39+ ghc : 9.8.4
3140
3241 steps :
3342 - uses : actions/checkout@v3
3443
35- - name : Set up GHC ${{ matrix.ghc-version }}
44+ - name : Set up Stack LTS ${{ matrix.stack-lts }}
3645 uses : haskell-actions/setup@v2
3746 id : setup
3847 with :
39- ghc-version : ${{ matrix.ghc-version }}
40- # Defaults, added for clarity:
41- cabal-version : latest
42- cabal-update : true
48+ ghc-version : ${{ matrix.stack. ghc }}
49+ enable-stack : true
50+ stack-setup-ghc : true
51+ stack-no-global : true
4352
4453 - name : Configure the build
4554 run : |
46- cabal configure --enable-tests --enable-benchmarks --disable-documentation
47- cabal build --dry-run
55+ stack config set resolver lts-${{ matrix.stack.lts }}
56+ stack build --dry-run
4857 # The last step generates dist-newstyle/cache/plan.json for the cache key.
4958
5059 - name : Restore cached dependencies
@@ -54,32 +63,32 @@ jobs:
5463 key : ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
5564
5665 with :
57- path : ${{ steps.setup.outputs.cabal-store }}
66+ path : ${{ steps.setup.outputs.stack-root }}
5867 key : ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
5968 restore-keys : ${{ env.key }}-
6069
6170 - name : Install dependencies
62- run : cabal build all --only-dependencies
71+ run : stack build --only-dependencies
6372
6473 # Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail.
6574 - name : Save cached dependencies
6675 uses : actions/cache/save@v3
6776 # Caches are immutable, trying to save with the same key would error.
6877 if : ${{ steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }}
6978 with :
70- path : ${{ steps.setup.outputs.cabal-store }}
79+ path : ${{ steps.setup.outputs.stack-root }}
7180 key : ${{ steps.cache.outputs.cache-primary-key }}
7281
7382 - name : Build
74- run : cabal build all
83+ run : stack build
7584
7685 - name : Run tests
77- run : cabal test all
86+ run : stack test
7887
7988 - name : Check cabal file
80- run : cabal check
89+ run : stack check
8190 continue-on-error : true
8291
8392 - name : Build documentation
84- run : cabal haddock all
93+ run : stack haddock
8594...
0 commit comments