11---
2- name : cabal -build
2+ name : stack -build
33on :
44 push :
55 branches : main
@@ -11,40 +11,51 @@ 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 : &default-lts 21.25
22+ ghc : &default-ghc 9.4.8
23+
24+ - lts : 22.44
25+ ghc : 9.6.7
26+
27+ - lts : 23.28
28+ ghc : 9.8.4
2429
2530 include :
2631 - os : windows
27- ghc-version : 9.6
32+ stack :
33+ lts : *default-lts
34+ ghc : *default-ghc
2835
2936 - os : macos
30- ghc-version : 9.6
37+ stack :
38+ lts : *default-lts
39+ ghc : *default-ghc
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+ echo "with key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}"
56+
57+ stack config set resolver lts-${{ matrix.stack.lts }}
58+ stack build --dry-run
4859 # The last step generates dist-newstyle/cache/plan.json for the cache key.
4960
5061 - name : Restore cached dependencies
@@ -54,32 +65,32 @@ jobs:
5465 key : ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
5566
5667 with :
57- path : ${{ steps.setup.outputs.cabal-store }}
68+ path : ${{ steps.setup.outputs.stack-root }}
5869 key : ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
5970 restore-keys : ${{ env.key }}-
6071
6172 - name : Install dependencies
62- run : cabal build all --only-dependencies
73+ run : stack build --only-dependencies
6374
6475 # Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail.
6576 - name : Save cached dependencies
6677 uses : actions/cache/save@v3
6778 # Caches are immutable, trying to save with the same key would error.
6879 if : ${{ steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }}
6980 with :
70- path : ${{ steps.setup.outputs.cabal-store }}
81+ path : ${{ steps.setup.outputs.stack-root }}
7182 key : ${{ steps.cache.outputs.cache-primary-key }}
7283
7384 - name : Build
74- run : cabal build all
85+ run : stack build
7586
7687 - name : Run tests
77- run : cabal test all
88+ run : stack test
7889
7990 - name : Check cabal file
80- run : cabal check
91+ run : stack check
8192 continue-on-error : true
8293
8394 - name : Build documentation
84- run : cabal haddock all
95+ run : stack haddock
8596...
0 commit comments