-
Notifications
You must be signed in to change notification settings - Fork 66
305 lines (291 loc) · 11.1 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
name: Haskell CI
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: GHC ${{matrix.name}}
env:
# packcheck environment variables
LC_ALL: C.UTF-8
BUILD: ${{ matrix.build }}
# For updating see: https://downloads.haskell.org/~ghcup/
GHCUP_VERSION: 0.1.20.0
DOCSPEC_URL: https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20210111/cabal-docspec-0.0.0.20210111.xz
DOCSPEC_OPTIONS: "--timeout 60 --check-properties --property-variables xs"
GHCUP_GHC_OPTIONS: ${{ matrix.ghcup_ghc_options }}
GHCVER: ${{ matrix.ghc_version }}
CABALVER: ${{ matrix.cabal_version }}
DISABLE_DOCS: ${{ matrix.disable_docs }}
ENABLE_DOCSPEC: ${{ matrix.enable_docspec }}
DISABLE_TEST: ${{ matrix.disable_test }}
DISABLE_BENCH: ${{ matrix.disable_bench }}
DISABLE_DIST_CHECKS: ${{ matrix.disable_dist_checks }}
SDIST_OPTIONS: ${{ matrix.sdist_options }}
DISABLE_SDIST_BUILD: ${{ matrix.disable_sdist_build }}
# Cabal options
CABAL_REINIT_CONFIG: y
# Github has machines with 2 CPUS and 6GB memory so the cabal jobs
# default (ncpus) is good, this can be checked from the packcheck
# output in case it changes.
CABAL_BUILD_OPTIONS: ${{ matrix.cabal_build_options }}
CABAL_BUILD_TARGETS: ${{ matrix.cabal_build_targets }}
CABAL_PROJECT: ${{ matrix.cabal_project }}
CABAL_CHECK_RELAX: y
# Stack options
STACK_UPGRADE: "y"
RESOLVER: ${{ matrix.resolver }}
STACK_YAML: ${{ matrix.stack_yaml }}
STACK_BUILD_OPTIONS: ${{ matrix.stack_build_options }}
# packcheck location and revision
PACKCHECK: "./packcheck.sh"
PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck"
PACKCHECK_GITHUB_COMMIT: "e575ff318c93add2a6d3f9107a52c5e37c666a98"
# Pull token from "secrets" setting of the github repo
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
COVERAGE: ${{ matrix.coverage }}
# hlint
HLINT_VERSION: 3.6.1
HLINT_OPTIONS: "lint"
HLINT_TARGETS: "core/src src test benchmark"
# Subdir
SUBDIR: ${{ matrix.subdir }}
runs-on: ${{ matrix.runner }}
continue-on-error: ${{ matrix.ignore_error }}
strategy:
fail-fast: true
matrix:
# The order is important to optimize fail-fast.
name:
- 9.10.1-Werror
# - 9.8.1-docspec
# - 8.10.7-coverage
# Note: if cabal.project is not specified benchmarks and tests won't
# run. But we need at least one test where we test without
# cabal.project because that is how hackage would build it.
include:
- name: head
ghc_version: head
# The URL may change, to find a working URL go to https://gitlab.haskell.org/ghc/ghc/-/jobs/
# Find a debian10/11/12 job, click on a passed/failed status, at the
# end of the output you will find the tar.xz name, put that tar
# name after "raw/", and put the job name after "job=".
# Also see https://github.com/mpickering/ghc-artefact-nix/blob/master/gitlab-artifact.nix
#
# May also use ghcup for installing ghc head version, use the
# version "LatestNightly", and the following config:
# ghcup config add-release-channel https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-0.0.7.yaml
ghcup_ghc_options: "-u https://gitlab.haskell.org/ghc/ghc/-/jobs/artifacts/master/raw/ghc-x86_64-linux-deb10-int_native-validate.tar.xz?job=x86_64-linux-deb10-int_native-validate"
runner: ubuntu-latest
build: cabal
cabal_build_options: "--flag limit-build-mem"
cabal_version: 3.12.1.0
cabal_project: cabal.project.ghc-head
disable_sdist_build: "y"
ignore_error: true
- name: 9.12.1-alpha
ghc_version: head
ghcup_ghc_options: "-u https://downloads.haskell.org/ghc/9.12.1-alpha1/ghc-9.12.20241014-x86_64-deb12-linux.tar.xz"
runner: ubuntu-latest
build: cabal
cabal_build_options: "--flag limit-build-mem"
cabal_version: 3.12.1.0
cabal_project: cabal.project.ghc-head
disable_sdist_build: "y"
ignore_error: false
# Note: use linux for warning build for convenient dev testing
- name: 9.10.1-Werror
ghc_version: 9.10.1
runner: ubuntu-latest
build: cabal
cabal_build_options: "--flag limit-build-mem"
cabal_version: 3.12.1.0
disable_sdist_build: "y"
cabal_project: cabal.project.Werror
ignore_error: false
- name: 9.10.1-macos
ghc_version: 9.10.1
runner: macos-latest
build: cabal
cabal_build_options: "--flag limit-build-mem"
cabal_version: 3.12.1.0
disable_sdist_build: "y"
cabal_project: cabal.project
ignore_error: false
- name: 9.10.1-fusion-inspection
ghc_version: 9.10.1
runner: ubuntu-latest
build: cabal
cabal_version: 3.12.1.0
disable_sdist_build: "y"
cabal_project: cabal.project
cabal_build_options: "--flag fusion-plugin --flag inspection"
ignore_error: false
- name: 9.8.2-macos-stack
runner: macos-latest
build: stack
resolver: nightly-2024-09-26
stack_yaml: stack.yaml
disable_docs: "y"
disable_sdist_build: "y"
disable_dist_checks: "y"
disable_test: "y"
disable_bench: "y"
#sdist_options: "--ignore-check"
stack_build_options: "-v"
cabal_version: 3.12.1.0
ignore_error: true
# - name: 9.8.1-docspec
# ghc_version: 9.8.1
# runner: ubuntu-latest
# build: cabal
# cabal_version: 3.10.1.0
# cabal_project: cabal.project.doctest
# disable_test: "y"
# disable_bench: "y"
# disable_docs: "y"
# enable_docspec: "y"
# disable_sdist_build: "y"
# ignore_error: false
- name: 9.8.1-fusion-inspection
ghc_version: 9.8.1
runner: ubuntu-latest
build: cabal
cabal_version: 3.12.1.0
disable_sdist_build: "y"
cabal_project: cabal.project
cabal_build_options: "--flag fusion-plugin --flag inspection"
ignore_error: false
- name: 9.6.3-macos
ghc_version: 9.6.3
runner: macos-latest
build: cabal
cabal_version: 3.10.1.0
disable_sdist_build: "y"
cabal_project: cabal.project
ignore_error: false
- name: 9.4.7
ghc_version: 9.4.7
runner: ubuntu-latest
build: cabal
cabal_version: 3.8.1.0
disable_sdist_build: "y"
cabal_project: cabal.project
ignore_error: false
- name: 9.2.8
ghc_version: 9.2.8
runner: ubuntu-latest
build: cabal
cabal_project: cabal.project
cabal_version: 3.6.2.0
disable_sdist_build: "y"
ignore_error: false
- name: 9.0.2-streamly-sdist
ghc_version: 9.0.2
runner: ubuntu-latest
build: cabal
cabal_version: 3.6.2.0
cabal_project: cabal.project.streamly
ignore_error: true
- name: 9.0.2-streamly-core-sdist
ghc_version: 9.0.2
runner: ubuntu-latest
build: cabal
cabal_version: 3.6.2.0
subdir: core
ignore_error: false
- name: 8.10.7-noopt
runner: ubuntu-latest
build: cabal
cabal_version: 3.6.2.0
cabal_project: cabal.project
disable_sdist_build: "y"
disable_docs: "y"
disable_dist_checks: "y"
cabal_build_options: "--flags \"-opt\""
ignore_error: false
# - name: 8.10.7-coverage
# ghc_version: 8.10.7
# runner: ubuntu-latest
# coverage: "y"
# cabal_version: 3.6.2.0
# ignore_error: false
- name: 8.8.4
ghc_version: 8.8.4
runner: ubuntu-latest
build: cabal
cabal_version: 3.6.2.0
cabal_project: cabal.project
disable_sdist_build: "y"
disable_docs: "y"
ignore_error: false
- name: 8.6.5-debug-unoptimized
ghc_version: 8.6.5
runner: ubuntu-latest
build: cabal
cabal_version: 3.6.2.0
cabal_project: cabal.project
cabal_build_options: "--flag debug --flag -opt"
disable_sdist_build: "y"
disable_docs: "y"
ignore_error: false
# - name: hlint
# build: hlint
# runner: ubuntu-latest
# ignore_error: true
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
name: Cache common directories
with:
path: |
~/.local
~/.cabal
~/.stack
~/.ghcup
# Bump the key version to clear the cache
key: ${{ runner.os }}-${{ matrix.ghc_version }}-cabal-v2
- name: Download packcheck
run: |
if test ! -e "$PACKCHECK"
then
if test -z "$PACKCHECK_GITHUB_COMMIT"
then
die "PACKCHECK_GITHUB_COMMIT is not specified."
fi
PACKCHECK_URL=${PACKCHECK_GITHUB_URL}/${PACKCHECK_GITHUB_COMMIT}/packcheck.sh
curl --fail -sL -o "$PACKCHECK" $PACKCHECK_URL || exit 1
chmod +x $PACKCHECK
elif test ! -x "$PACKCHECK"
then
chmod +x $PACKCHECK
fi
- name: Run tests
run: |
if test -n "$COVERAGE"
then
# Run tests with coverage
cabal update
# Build hpc-coveralls if needed
sudo apt-get install -y libcurl4-gnutls-dev
export PATH=$HOME/.cabal/bin:$PATH
which hpc-coveralls 2>/dev/null || cabal install --project-file cabal.project.hpc-coveralls hpc-coveralls
# Run tests and upload results to coveralls.io
bin/test.sh --coverage --raw
# XXX Uncomment this and fix it properly later
# hpc-coveralls --repo-token="$COVERALLS_TOKEN" --coverage-mode=StrictlyFullLines
else
# /usr/local/opt/curl/bin for macOS
export PATH=$HOME/.local/bin:$HOME/.ghcup/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/opt/curl/bin
if test -n "$SUBDIR"
then
mv "$PACKCHECK" "$SUBDIR/packcheck.sh"
# This is required as dist-newstyle will be created on the top level
# directory as it is considered the working dir.
rm cabal.project
cd "$SUBDIR"
fi
bash -c "$PACKCHECK $BUILD"
fi