6
6
#
7
7
# haskell-ci regenerate
8
8
#
9
- # For more information, see https://github.com/haskell-CI /haskell-ci
9
+ # For more information, see https://github.com/andreasabel /haskell-ci
10
10
#
11
- # version: 0.12.1
11
+ # version: 0.17.20231002
12
12
#
13
- # REGENDATA ("0.12.1 ",["github","--no-cabal-check","agda-stdlib-utils.cabal"])
13
+ # REGENDATA ("0.17.20231002 ",["github","--no-cabal-check","agda-stdlib-utils.cabal"])
14
14
#
15
15
name : Haskell-CI
16
16
on :
17
- push :
18
- branches :
19
- - master
20
- - experimental
21
- pull_request :
22
- branches :
23
- - master
24
- - experimental
17
+ - push
18
+ - pull_request
25
19
jobs :
26
20
linux :
27
21
name : Haskell-CI - Linux - ${{ matrix.compiler }}
28
- runs-on : ubuntu-18.04
22
+ runs-on : ubuntu-20.04
23
+ timeout-minutes :
24
+ 60
29
25
container :
30
- image : buildpack-deps:xenial
26
+ image : buildpack-deps:focal
31
27
continue-on-error : ${{ matrix.allow-failure }}
32
28
strategy :
33
29
matrix :
34
30
include :
35
- - compiler : ghc-9.0.1
31
+ - compiler : ghc-9.8.0.20230929
32
+ compilerKind : ghc
33
+ compilerVersion : 9.8.0.20230929
34
+ setup-method : ghcup
35
+ allow-failure : true
36
+ - compiler : ghc-9.6.3
37
+ compilerKind : ghc
38
+ compilerVersion : 9.6.3
39
+ setup-method : ghcup
36
40
allow-failure : false
37
- - compiler : ghc-8.10.4
41
+ - compiler : ghc-9.4.7
42
+ compilerKind : ghc
43
+ compilerVersion : 9.4.7
44
+ setup-method : ghcup
45
+ allow-failure : false
46
+ - compiler : ghc-9.2.8
47
+ compilerKind : ghc
48
+ compilerVersion : 9.2.8
49
+ setup-method : ghcup
50
+ allow-failure : false
51
+ - compiler : ghc-9.0.2
52
+ compilerKind : ghc
53
+ compilerVersion : 9.0.2
54
+ setup-method : ghcup
55
+ allow-failure : false
56
+ - compiler : ghc-8.10.7
57
+ compilerKind : ghc
58
+ compilerVersion : 8.10.7
59
+ setup-method : ghcup
38
60
allow-failure : false
39
61
- compiler : ghc-8.8.4
62
+ compilerKind : ghc
63
+ compilerVersion : 8.8.4
64
+ setup-method : hvr-ppa
40
65
allow-failure : false
41
66
- compiler : ghc-8.6.5
67
+ compilerKind : ghc
68
+ compilerVersion : 8.6.5
69
+ setup-method : hvr-ppa
42
70
allow-failure : false
43
71
- compiler : ghc-8.4.4
72
+ compilerKind : ghc
73
+ compilerVersion : 8.4.4
74
+ setup-method : hvr-ppa
44
75
allow-failure : false
45
76
- compiler : ghc-8.2.2
77
+ compilerKind : ghc
78
+ compilerVersion : 8.2.2
79
+ setup-method : hvr-ppa
46
80
allow-failure : false
47
81
- compiler : ghc-8.0.2
82
+ compilerKind : ghc
83
+ compilerVersion : 8.0.2
84
+ setup-method : hvr-ppa
48
85
allow-failure : false
49
86
fail-fast : false
50
87
steps :
51
88
- name : apt
52
89
run : |
53
90
apt-get update
54
- apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common
55
- apt-add-repository -y 'ppa:hvr/ghc'
56
- apt-get update
57
- apt-get install -y $CC cabal-install-3.4
91
+ apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
92
+ if [ "${{ matrix.setup-method }}" = ghcup ]; then
93
+ mkdir -p "$HOME/.ghcup/bin"
94
+ curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
95
+ chmod a+x "$HOME/.ghcup/bin/ghcup"
96
+ "$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml;
97
+ "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
98
+ "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
99
+ else
100
+ apt-add-repository -y 'ppa:hvr/ghc'
101
+ apt-get update
102
+ apt-get install -y "$HCNAME"
103
+ mkdir -p "$HOME/.ghcup/bin"
104
+ curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
105
+ chmod a+x "$HOME/.ghcup/bin/ghcup"
106
+ "$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml;
107
+ "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
108
+ fi
58
109
env :
59
- CC : ${{ matrix.compiler }}
110
+ HCKIND : ${{ matrix.compilerKind }}
111
+ HCNAME : ${{ matrix.compiler }}
112
+ HCVER : ${{ matrix.compilerVersion }}
60
113
- name : Set PATH and environment variables
61
114
run : |
62
115
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
63
- echo "LANG=C.UTF-8" >> $GITHUB_ENV
64
- echo "CABAL_DIR=$HOME/.cabal" >> $GITHUB_ENV
65
- echo "CABAL_CONFIG=$HOME/.cabal/config" >> $GITHUB_ENV
66
- HCDIR=$(echo "/opt/$CC" | sed 's/-/\//')
67
- HCNAME=ghc
68
- HC=$HCDIR/bin/$HCNAME
69
- echo "HC=$HC" >> $GITHUB_ENV
70
- echo "HCPKG=$HCDIR/bin/$HCNAME-pkg" >> $GITHUB_ENV
71
- echo "HADDOCK=$HCDIR/bin/haddock" >> $GITHUB_ENV
72
- echo "CABAL=/opt/cabal/3.4/bin/cabal -vnormal+nowrap" >> $GITHUB_ENV
116
+ echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
117
+ echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
118
+ echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
119
+ HCDIR=/opt/$HCKIND/$HCVER
120
+ if [ "${{ matrix.setup-method }}" = ghcup ]; then
121
+ HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
122
+ HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
123
+ HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
124
+ echo "HC=$HC" >> "$GITHUB_ENV"
125
+ echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
126
+ echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
127
+ echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
128
+ else
129
+ HC=$HCDIR/bin/$HCKIND
130
+ echo "HC=$HC" >> "$GITHUB_ENV"
131
+ echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
132
+ echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
133
+ echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
134
+ fi
135
+
73
136
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
74
- echo "HCNUMVER=$HCNUMVER" >> $GITHUB_ENV
75
- echo "ARG_TESTS=--enable-tests" >> $GITHUB_ENV
76
- echo "ARG_BENCH=--enable-benchmarks" >> $GITHUB_ENV
77
- echo "HEADHACKAGE=false" >> $GITHUB_ENV
78
- echo "ARG_COMPILER=--$HCNAME --with-compiler=$HC" >> $GITHUB_ENV
79
- echo "GHCJSARITH=0" >> $GITHUB_ENV
137
+ echo "HCNUMVER=$HCNUMVER" >> " $GITHUB_ENV"
138
+ echo "ARG_TESTS=--enable-tests" >> " $GITHUB_ENV"
139
+ echo "ARG_BENCH=--enable-benchmarks" >> " $GITHUB_ENV"
140
+ if [ $((HCNUMVER >= 90800)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE= false" >> " $GITHUB_ENV" ; fi
141
+ echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> " $GITHUB_ENV"
142
+ echo "GHCJSARITH=0" >> " $GITHUB_ENV"
80
143
env :
81
- CC : ${{ matrix.compiler }}
144
+ HCKIND : ${{ matrix.compilerKind }}
145
+ HCNAME : ${{ matrix.compiler }}
146
+ HCVER : ${{ matrix.compilerVersion }}
82
147
- name : env
83
148
run : |
84
149
env
@@ -101,6 +166,22 @@ jobs:
101
166
repository hackage.haskell.org
102
167
url: http://hackage.haskell.org/
103
168
EOF
169
+ if $HEADHACKAGE; then
170
+ cat >> $CABAL_CONFIG <<EOF
171
+ repository head.hackage.ghc.haskell.org
172
+ url: https://ghc.gitlab.haskell.org/head.hackage/
173
+ secure: True
174
+ root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
175
+ 26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
176
+ f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
177
+ key-threshold: 3
178
+ active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
179
+ EOF
180
+ fi
181
+ cat >> $CABAL_CONFIG <<EOF
182
+ program-default-options
183
+ ghc-options: $GHCJOBS +RTS -M3G -RTS
184
+ EOF
104
185
cat $CABAL_CONFIG
105
186
- name : versions
106
187
run : |
@@ -113,14 +194,14 @@ jobs:
113
194
- name : install cabal-plan
114
195
run : |
115
196
mkdir -p $HOME/.cabal/bin
116
- curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2 .0/cabal-plan-0.6.2 .0-x86_64-linux.xz > cabal-plan.xz
117
- echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c -
197
+ curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.7.3 .0/cabal-plan-0.7.3 .0-x86_64-linux.xz > cabal-plan.xz
198
+ echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
118
199
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
119
200
rm -f cabal-plan.xz
120
201
chmod a+x $HOME/.cabal/bin/cabal-plan
121
202
cabal-plan --version
122
203
- name : checkout
123
- uses : actions/checkout@v2
204
+ uses : actions/checkout@v4
124
205
with :
125
206
path : source
126
207
- name : initial cabal.project for sdist
@@ -139,23 +220,27 @@ jobs:
139
220
- name : generate cabal.project
140
221
run : |
141
222
PKGDIR_agda_stdlib_utils="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/agda-stdlib-utils-[0-9.]*')"
142
- echo "PKGDIR_agda_stdlib_utils=${PKGDIR_agda_stdlib_utils}" >> $GITHUB_ENV
223
+ echo "PKGDIR_agda_stdlib_utils=${PKGDIR_agda_stdlib_utils}" >> "$GITHUB_ENV"
224
+ rm -f cabal.project cabal.project.local
143
225
touch cabal.project
144
226
touch cabal.project.local
145
227
echo "packages: ${PKGDIR_agda_stdlib_utils}" >> cabal.project
146
228
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package agda-stdlib-utils" >> cabal.project ; fi
147
229
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
148
230
cat >> cabal.project <<EOF
149
231
EOF
232
+ if $HEADHACKAGE; then
233
+ echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
234
+ fi
150
235
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(agda-stdlib-utils)$/; }' >> cabal.project.local
151
236
cat cabal.project
152
237
cat cabal.project.local
153
238
- name : dump install plan
154
239
run : |
155
240
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
156
241
cabal-plan
157
- - name : cache
158
- uses : actions/cache@v2
242
+ - name : restore cache
243
+ uses : actions/cache/restore@v3
159
244
with :
160
245
key : ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
161
246
path : ~/.cabal/store
@@ -170,7 +255,16 @@ jobs:
170
255
- name : build
171
256
run : |
172
257
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
258
+ - name : haddock
259
+ run : |
260
+ $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
173
261
- name : unconstrained build
174
262
run : |
175
263
rm -f cabal.project.local
176
264
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
265
+ - name : save cache
266
+ uses : actions/cache/save@v3
267
+ if : always()
268
+ with :
269
+ key : ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
270
+ path : ~/.cabal/store
0 commit comments