1
1
---
2
- name : cabal -build
2
+ name : stack -build
3
3
on :
4
4
push :
5
5
branches : main
@@ -11,40 +11,49 @@ permissions:
11
11
12
12
jobs :
13
13
build :
14
- name : ${{ matrix.os }} / ghc ${{ matrix.ghc-version }}
14
+ name : LTS ${{ matrix.stack.lts }} / ghc- ${{ matrix.stack. ghc }} / ${{ matrix.os }}
15
15
runs-on : ${{ matrix.os }}-latest
16
16
strategy :
17
17
fail-fast : false
18
18
matrix :
19
19
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
24
29
25
30
include :
26
31
- os : windows
27
- ghc-version : 9.6
32
+ stack :
33
+ lts : 21.25
34
+ ghc : 9.8.4
28
35
29
36
- os : macos
30
- ghc-version : 9.6
37
+ stack :
38
+ lts : 21.25
39
+ ghc : 9.8.4
31
40
32
41
steps :
33
42
- uses : actions/checkout@v3
34
43
35
- - name : Set up GHC ${{ matrix.ghc-version }}
44
+ - name : Set up Stack LTS ${{ matrix.stack-lts }}
36
45
uses : haskell-actions/setup@v2
37
46
id : setup
38
47
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
43
52
44
53
- name : Configure the build
45
54
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
48
57
# The last step generates dist-newstyle/cache/plan.json for the cache key.
49
58
50
59
- name : Restore cached dependencies
@@ -54,32 +63,32 @@ jobs:
54
63
key : ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
55
64
56
65
with :
57
- path : ${{ steps.setup.outputs.cabal-store }}
66
+ path : ${{ steps.setup.outputs.stack-root }}
58
67
key : ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
59
68
restore-keys : ${{ env.key }}-
60
69
61
70
- name : Install dependencies
62
- run : cabal build all --only-dependencies
71
+ run : stack build --only-dependencies
63
72
64
73
# Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail.
65
74
- name : Save cached dependencies
66
75
uses : actions/cache/save@v3
67
76
# Caches are immutable, trying to save with the same key would error.
68
77
if : ${{ steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }}
69
78
with :
70
- path : ${{ steps.setup.outputs.cabal-store }}
79
+ path : ${{ steps.setup.outputs.stack-root }}
71
80
key : ${{ steps.cache.outputs.cache-primary-key }}
72
81
73
82
- name : Build
74
- run : cabal build all
83
+ run : stack build
75
84
76
85
- name : Run tests
77
- run : cabal test all
86
+ run : stack test
78
87
79
88
- name : Check cabal file
80
- run : cabal check
89
+ run : stack check
81
90
continue-on-error : true
82
91
83
92
- name : Build documentation
84
- run : cabal haddock all
93
+ run : stack haddock
85
94
...
0 commit comments