1
1
on : [push]
2
2
name : Build and test
3
3
jobs :
4
- build :
4
+ ci :
5
5
name : Build on ${{ matrix.os }}
6
+ env :
7
+ stack : stack --system-ghc
6
8
runs-on : ${{ matrix.os }}
7
9
strategy :
8
10
fail-fast : false
@@ -12,76 +14,41 @@ jobs:
12
14
- name : Check out
13
15
uses : actions/checkout@v2
14
16
15
- - name : Cache GHC installation
16
- uses : actions/cache@v4
17
- id : ghcup
18
- with :
19
- path : |
20
- ~/.ghcup/bin/*
21
- ~/.ghcup/cache/*
22
- ~/.ghcup/config.yaml
23
- ~/.ghcup/ghc/*
24
- key : CI-ghcup
25
-
26
17
- name : Setup Haskell
27
18
uses : haskell-actions/setup@v2
28
- if : steps.ghcup.outputs.cache-hit != 'true'
29
19
with :
30
20
enable-stack : true
31
21
32
- - name : Cache Stackage package index
33
- id : pantry
22
+ - name : Cache
34
23
uses : actions/cache@v4
35
- with :
36
- path : ~/.stack/pantry
37
- key : CI-pantry-${{ env.STACK_LTS }}
38
-
39
- - name : Recompute Stackage package index
40
- if : steps.pantry.outputs.cache-hit != 'true'
41
- run : stack update
42
-
43
- - name : Cache Haskell dependencies
44
- uses : actions/cache@v3
45
24
with :
46
25
path : |
47
- ~/.stack/stack.sqlite3
48
- ~/.stack/snapshots
49
- key : CI-testdeps--${{ env.STACK_LTS }}--${{ hashFiles('stack.yaml.lock') }}
50
- restore-keys : |
51
- CI-testdeps--${{ env.STACK_LTS }}--
52
- CI-testdeps--
53
-
54
- - name : Cache Haskell project buildstate
55
- uses : actions/cache@v4
56
- with :
57
- path : .stack-work
58
- key : CI-builddir--${{ env.GHC_VERSION }}
26
+ ~/.stack
27
+ .stack-work
28
+ key : ${{ matrix.os }}-stack-${{ hashFiles('./stack.yaml.lock') }}
59
29
60
30
- name : Build package dependencies
61
31
run : |
62
- stack build --no-run-tests --no-run-benchmarks --only-dependencies
32
+ $ stack build --no-run-tests --no-run-benchmarks --only-dependencies
63
33
64
34
- name : Build package
65
35
run : |
66
- stack build --no-run-tests --no-run-benchmarks
36
+ $ stack build --no-run-tests --no-run-benchmarks
67
37
68
38
- name : Build testing dependencies
69
39
run : |
70
- stack build --no-run-tests --no-run-benchmarks --test --bench
40
+ $ stack build --no-run-tests --no-run-benchmarks --test --bench
71
41
72
42
- name : Run tests
73
43
run : |
74
- stack build --test --no-run-benchmarks
44
+ $ stack build --test --no-run-benchmarks
75
45
76
46
- name : Build documentation
77
47
run : |
78
- stack haddock
48
+ $ stack haddock
79
49
80
50
- name : Check documentation
51
+ if : matrix.os != 'windows-latest'
81
52
run : |
82
- stack install doctest
53
+ $ stack install doctest
83
54
$(stack path --local-bin)${path.sep}doctest src/
84
-
85
- - name : Deploy
86
- run : |
87
- stack path --local-install-root
0 commit comments