1
1
name : Integration tests
2
2
3
3
on :
4
- pull_request :
5
4
push :
6
- branches :
7
- - master
8
- - stable
9
- - rc/**
10
5
tags :
11
6
- ' **'
12
7
workflow_dispatch :
13
8
14
- # Stack will use the value of the GH_TOKEN environment variable to authenticate
15
- # its requests of the GitHub REST API, providing a higher request rate limit.
16
- env :
17
- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
18
-
19
- # As of 6 May 2024, ubuntu-latest and windows-latest come with Stack 2.15.5 and
20
- # GHC 9.8.2. However, macos-13 and macos-latest do not come with Haskell tools.
21
- # windows-latest comes with NSIS 3.08, for which the default value of the
22
- # 'Unicode' installer attribute is 'true'. However, that is not the 'large
23
- # strings' build of NSIS and creates installers that corrupt the PATH
24
- # environment variable if the default string length of 1024 characters is
25
- # exceeded.
9
+ # As of 1 February 2024, ubuntu-latest, windows-latest and macos-latest come
10
+ # with Stack 2.13.1 and GHC 9.8.1. windows-latest comes with NSIS 3.08, for
11
+ # which the default value of the 'Unicode' installer attribute is 'true'.
12
+ # However, that is not the 'large strings' build of NSIS and creates installers
13
+ # that corrupt the PATH environment variable if the default string length of
14
+ # 1024 characters is exceeded.
26
15
27
16
jobs :
28
17
integration-tests :
@@ -34,17 +23,17 @@ jobs:
34
23
include :
35
24
- os : ubuntu-latest
36
25
release-args : " --alpine"
37
- cache-bust : " 2024-01-20 "
26
+ cache-bust : " 2024-05-17 "
38
27
- os : windows-latest
39
28
release-args : " "
40
- cache-bust : " 2024-01-20 "
29
+ cache-bust : " 2024-05-17 "
41
30
- os : macos-13
42
31
release-args : " "
43
- cache-bust : " 2024-01-20 "
44
- # macos-latest provides macOS/AArch64 (M1)
32
+ cache-bust : " 2024-05-17 "
33
+ # macos-14 provides macOS/AArch64 (M1)
45
34
- os : macos-latest
46
35
release-args : " "
47
- cache-bust : " 2024-02-02 "
36
+ cache-bust : " 2024-05-17 "
48
37
steps :
49
38
- name : Clone project
50
39
uses : actions/checkout@v4
@@ -160,79 +149,71 @@ jobs:
160
149
name : ${{ runner.os }}-${{ runner.arch }}
161
150
path : _release/stack-*
162
151
163
- configuration :
164
- name : Check for self-hosted runners
165
- runs-on : ubuntu-latest
166
- env :
167
- CAN_SIGN : ${{ secrets.RELEASE_SIGNING_KEY != '' }}
168
- outputs :
169
- arm64-runner : ${{ steps.runners.outputs.arm64 }}
170
- can-sign : ${{ env.CAN_SIGN }}
171
- test-arm64 : ${{ steps.runners.outputs.test-arm64 }}
172
- steps :
173
- - name : Check for hosted runners
174
- id : runners
175
- shell : bash
176
- env :
177
- SELF_HOSTED_RUNNERS : ${{ secrets.SELF_HOSTED_RUNNERS || (github.repository_owner == 'commercialhaskell' && 'arm64') }}
178
- run : |
179
- echo "runners=$SELF_HOSTED_RUNNERS" >> $GITHUB_OUTPUT
180
- if echo "$SELF_HOSTED_RUNNERS" | grep -q 'arm64'; then
181
- echo "arm64=['self-hosted', 'linux', 'ARM64']" >> $GITHUB_OUTPUT
182
- echo "test-arm64=true" >> $GITHUB_OUTPUT
183
- else
184
- echo "arm64='ubuntu-latest'" >> $GITHUB_OUTPUT
185
- echo "test-arm64=false" >> $GITHUB_OUTPUT
186
- fi
187
-
188
152
linux-arm64 :
189
153
name : Linux ARM64
190
- runs-on : ${{ fromJSON(needs.configuration.outputs.arm64-runner) }}
191
- needs : configuration
154
+ runs-on : [self-hosted, Linux, ARM64, maerwald]
192
155
steps :
193
- - name : Skipping ARM64
194
- if : needs.configuration.outputs.test-arm64 == 'false'
195
- shell : bash
196
- run : |
197
- echo '::notice title=ARM64 skipped::To build ARM64, a self-hosted runner needs to be configured and the SELF_HOSTED_RUNNERS secret must contain arm64'
198
- - name : Clone project
199
- if : needs.configuration.outputs.test-arm64 == 'true'
200
- uses : actions/checkout@v4
201
- - name : Install deps
202
- shell : bash
203
- run : |
204
- set -ex
156
+ - name : git config
157
+ run : |
158
+ git config --global --get-all safe.directory | grep '^\*$' || git config --global --add safe.directory "*"
159
+ shell : bash
205
160
206
- # As of 19 August 2023, the self-hosted runner comes with Stack 2.11.1,
207
- # but it is not on the PATH. Logging the version for information.
208
- /usr/local/bin/stack --version
161
+ - name : Checkout code
162
+ uses : actions/checkout@v4
163
+ with :
164
+ submodules : ' true'
209
165
210
- set +ex
211
- - name : Build bindist
212
- if : needs.configuration.outputs.test-arm64 == 'true'
213
- shell : bash
214
- run : |
215
- # Stack's project-level configuration (stack.yaml) specifies the
216
- # multi-architecture (including Linux/Aarch64) Docker image published by
217
- # Oliver Benz (@benz0li, on GitHub). That image comes with Stack 2.11.1.
218
- # (Note that the online documentation for '--docker-stack-exe image'
219
- # specifies that the host Stack and image Stack must have the same
220
- # version number.)
221
- /usr/local/bin/stack etc/scripts/release.hs build --alpine --build-args --docker-stack-exe=image
166
+ - name : Run build (aarch64 linux)
167
+ run : |
168
+ export CI_PROJECT_DIR="${GITHUB_WORKSPACE}"
169
+ export GHCUP_INSTALL_BASE_PREFIX="$CI_PROJECT_DIR"
170
+ export GHCUP_BIN="$GHCUP_INSTALL_BASE_PREFIX/.ghcup/bin"
171
+ export PATH="$GHCUP_BIN:$PATH"
172
+ export CABAL_DIR="$CI_PROJECT_DIR/cabal"
173
+ export STACK_ROOT="${GITHUB_WORKSPACE}"/.stack
174
+ curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_ADJUST_CABAL_CONFIG=yes sh
175
+ ghcup -s https://raw.githubusercontent.com/haskell/ghcup-metadata/develop/ghcup-vanilla-0.0.8.yaml run --install --stack=latest -- stack --allow-different-user etc/scripts/release.hs build --allow-dirty --alpine --build-args --docker-stack-exe=image
222
176
223
- - name : Upload bindist
224
- if : needs.configuration.outputs.test-arm64 == 'true'
225
- uses : actions/upload-artifact@v4
226
- with :
227
- name : Linux-ARM64
228
- path : _release/stack-*
177
+ - name : Upload bindist
178
+ uses : actions/upload-artifact@v4
179
+ with :
180
+ name : Linux-ARM64
181
+ path : _release/stack-*
182
+
183
+ freebsd-x64 :
184
+ name : FreeBSD X64
185
+ runs-on : [self-hosted, FreeBSD, X64]
186
+ steps :
187
+ - name : Checkout code
188
+ uses : actions/checkout@v3
189
+ with :
190
+ submodules : ' true'
191
+
192
+ - name : Run build
193
+ run : |
194
+ sed -i.bak -e 's/quarterly/latest/' /etc/pkg/FreeBSD.conf
195
+ pkg install -y ghc gcc curl git bash misc/compat10x misc/compat11x misc/compat12x gmake libiconv devel/stack
196
+ tzsetup Etc/GMT
197
+ adjkerntz -a
198
+ export CI_PROJECT_DIR="${GITHUB_WORKSPACE}"
199
+ export GHCUP_INSTALL_BASE_PREFIX="$CI_PROJECT_DIR"
200
+ export GHCUP_BIN="$GHCUP_INSTALL_BASE_PREFIX/.ghcup/bin"
201
+ export PATH="$GHCUP_BIN:$PATH"
202
+ export CABAL_DIR="$CI_PROJECT_DIR/cabal"
203
+ export STACK_ROOT="${GITHUB_WORKSPACE}"/.stack
204
+ curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_ADJUST_CABAL_CONFIG=yes sh
205
+ stack etc/scripts/release.hs build --allow-dirty
206
+ - name : Upload bindist
207
+ uses : actions/upload-artifact@v4
208
+ with :
209
+ name : FreeBSD-X64
210
+ path : _release/stack-*
229
211
230
212
github-release :
231
213
name : Create GitHub release
232
214
permissions :
233
215
contents : write
234
216
needs :
235
- - configuration
236
217
- integration-tests
237
218
- linux-arm64
238
219
runs-on : ubuntu-latest
@@ -259,27 +240,25 @@ jobs:
259
240
name : Windows-X64
260
241
path : _release
261
242
- name : Download Linux/AArch64 artifact
262
- if : needs.configuration.outputs.test-arm64 == 'true'
263
243
uses : actions/download-artifact@v4
264
244
with :
265
245
name : Linux-ARM64
266
246
path : _release
247
+ - name : Download FreeBSD/X64 artifact
248
+ uses : actions/download-artifact@v4
249
+ with :
250
+ name : FreeBSD-X64
251
+ path : _release
267
252
- name : Hash and sign assets
268
- if : needs.configuration.outputs.can-sign == 'true'
269
253
shell : bash
270
- env :
271
- RELEASE_SIGNING_KEY : ${{ secrets.RELEASE_SIGNING_KEY }}
272
254
run : |
273
255
set -e
274
- echo "$RELEASE_SIGNING_KEY"|gpg --import
275
256
cd _release
276
257
for asset in *; do
277
258
shasum -a 256 "$asset" >"$asset.sha256"
278
- gpg --digest-algo=sha512 --detach-sig --armor -u 0x575159689BEFB442 "$asset"
279
259
done
280
260
- name : Create GitHub release (final)
281
261
id : github_release_final
282
- if : " !startsWith(github.ref, 'refs/tags/rc/')"
283
262
284
263
env :
285
264
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
@@ -296,19 +275,7 @@ jobs:
296
275
[INSERT CONTRIBUTORS]
297
276
draft : true
298
277
prerelease : false
299
- - name : Create GitHub release (release candidate)
300
- id : github_release_rc
301
- if : " startsWith(github.ref, 'refs/tags/rc/')"
302
-
303
- env :
304
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
305
- with :
306
- body : |
307
- **Changes since v[INSERT PREVIOUS VERSION]:**
308
278
309
- [INSERT CHANGELOG]
310
- draft : true
311
- prerelease : true
312
279
- name : Upload assets to GitHub release (final)
313
280
if : " !startsWith(github.ref, 'refs/tags/rc/')"
314
281
uses : xresloader/upload-to-github-release@v1
@@ -320,14 +287,3 @@ jobs:
320
287
prerelease : false
321
288
overwrite : true
322
289
release_id : ${{ steps.github_release_final.outputs.id }}
323
- - name : Upload assets to GitHub release (release candidate)
324
- if : " startsWith(github.ref, 'refs/tags/rc/')"
325
- uses : xresloader/upload-to-github-release@v1
326
- env :
327
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
328
- with :
329
- file : " _release/*"
330
- draft : true
331
- prerelease : true
332
- overwrite : true
333
- release_id : ${{ steps.github_release_rc.outputs.id }}
0 commit comments