-
Notifications
You must be signed in to change notification settings - Fork 3
141 lines (124 loc) · 3.75 KB
/
haskell.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Haskell CI
on:
push:
branches:
- master
- ci-*
pull_request:
branches:
- master
- ci-*
jobs:
stack:
name: Stack GHC ${{ matrix.plan.ghc }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
plan:
- ghc: '9.8.2'
resolver: 'nightly-2024-03-08'
allow-fail: false
flags: ''
- ghc: '9.6.4'
resolver: 'lts-22.12'
- ghc: '9.4.8'
resolver: 'lts-21.25'
- ghc: '9.2.8'
resolver: 'lts-20.26'
- ghc: '9.0.2'
resolver: 'lts-19.33'
- ghc: '8.10.7'
resolver: 'lts-18.28'
- ghc: '8.8.4'
resolver: 'lts-16.31'
- ghc: '8.6.5'
resolver: 'lts-14.27'
- ghc: '8.4.4'
resolver: 'lts-12.26'
- ghc: '8.2.2'
resolver: 'lts-11.22'
# Stack 2.15 dropped support for GHC 8.0 and lower
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.plan.allow-fail == true }}
env:
STACK: stack --no-terminal --system-ghc --resolver ${{ matrix.plan.resolver }}
FLAGS: ${{ matrix.plan.flags }}
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
id: cabal-setup-haskell
with:
ghc-version: ${{ matrix.plan.ghc }}
enable-stack: true
- name: Get stack version
run: |
STACK_VERSION=$(stack --numeric-version)
echo "STACK_VERSION=${STACK_VERSION}" >> "${GITHUB_ENV}"
- uses: actions/cache@v4
with:
path: ~/.stack
key: ${{ runner.os }}-stack-${{ env.STACK_VERSION }}-ghc-${{ matrix.plan.ghc }}-resolver-${{ matrix.plan.resolver }}
- name: Configure
run: |
set -ex
echo "resolver: ${{ matrix.plan.resolver }}" > stack.yaml
rm -f stack.yaml.lock
$STACK clean
- name: Install dependencies
run: $STACK test --bench --only-dependencies $FLAGS
- name: Build
run: $STACK build --bench --haddock --no-haddock-deps $FLAGS
- name: Test
run: $STACK -j 1 test --bench --no-run-benchmarks --haddock --no-haddock-deps $FLAGS
cabal:
name: Cabal GHC ${{ matrix.plan.ghc }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
plan:
- ghc: '9.8'
allow-fail: true
- ghc: '9.6'
- ghc: '9.4'
- ghc: '9.2'
- ghc: '9.0'
- ghc: '8.10'
- ghc: '8.8'
- ghc: '8.6'
- ghc: '8.4'
- ghc: '8.2'
- ghc: '8.0'
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.plan.allow-fail == true }}
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
id: cabal-setup-haskell
with:
ghc-version: ${{ matrix.plan.ghc }}
cabal-update: true
- name: Configure and freeze
run: |
set -ex
rm -f cabal.project.freeze
cabal v2-configure --enable-tests --enable-benchmarks --test-show-details streaming
cabal v2-freeze
test -f cabal.project.freeze
- uses: actions/cache@v4
env:
key: ${{ runner.os }}-cabal-${{ steps.cabal-setup-haskell.outputs.cabal-version }}-ghc-${{ steps.cabal-setup-haskell.outputs.ghc-version }}
with:
path: ${{ steps.cabal-setup-haskell.outputs.cabal-store }}
key: ${{ env.key }}-freeze-${{ hashFiles('cabal.project.freeze') }}
restore-keys: ${{ env.key }}-
- name: Install dependencies
run: cabal v2-build --only-dependencies all
- name: Build
run: cabal v2-build all
- name: Haddock
run: cabal v2-haddock all
continue-on-error: true
- name: Test
run: cabal v2-test --jobs=1 all