11name : Integration tests
22
33on :
4- pull_request :
54 push :
6- branches :
7- - master
8- - stable
9- - rc/**
105 tags :
116 - ' **'
127 workflow_dispatch :
138
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-
199# As of 1 February 2024, ubuntu-latest, windows-latest and macos-latest come
2010# with Stack 2.13.1 and GHC 9.8.1. windows-latest comes with NSIS 3.08, for
2111# which the default value of the 'Unicode' installer attribute is 'true'.
@@ -159,79 +149,71 @@ jobs:
159149 name : ${{ runner.os }}-${{ runner.arch }}
160150 path : _release/stack-*
161151
162- configuration :
163- name : Check for self-hosted runners
164- runs-on : ubuntu-latest
165- env :
166- CAN_SIGN : ${{ secrets.RELEASE_SIGNING_KEY != '' }}
167- outputs :
168- arm64-runner : ${{ steps.runners.outputs.arm64 }}
169- can-sign : ${{ env.CAN_SIGN }}
170- test-arm64 : ${{ steps.runners.outputs.test-arm64 }}
171- steps :
172- - name : Check for hosted runners
173- id : runners
174- shell : bash
175- env :
176- SELF_HOSTED_RUNNERS : ${{ secrets.SELF_HOSTED_RUNNERS || (github.repository_owner == 'commercialhaskell' && 'arm64') }}
177- run : |
178- echo "runners=$SELF_HOSTED_RUNNERS" >> $GITHUB_OUTPUT
179- if echo "$SELF_HOSTED_RUNNERS" | grep -q 'arm64'; then
180- echo "arm64=['self-hosted', 'linux', 'ARM64']" >> $GITHUB_OUTPUT
181- echo "test-arm64=true" >> $GITHUB_OUTPUT
182- else
183- echo "arm64='ubuntu-latest'" >> $GITHUB_OUTPUT
184- echo "test-arm64=false" >> $GITHUB_OUTPUT
185- fi
186-
187152 linux-arm64 :
188153 name : Linux ARM64
189- runs-on : ${{ fromJSON(needs.configuration.outputs.arm64-runner) }}
190- needs : configuration
154+ runs-on : [self-hosted, Linux, ARM64, maerwald]
191155 steps :
192- - name : Skipping ARM64
193- if : needs.configuration.outputs.test-arm64 == 'false'
194- shell : bash
195- run : |
196- 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'
197- - name : Clone project
198- if : needs.configuration.outputs.test-arm64 == 'true'
199- uses : actions/checkout@v4
200- - name : Install deps
201- shell : bash
202- run : |
203- 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
204160
205- # As of 19 August 2023, the self-hosted runner comes with Stack 2.11.1,
206- # but it is not on the PATH. Logging the version for information.
207- /usr/local/bin/stack --version
161+ - name : Checkout code
162+ uses : actions/checkout@v4
163+ with :
164+ submodules : ' true'
208165
209- set +ex
210- - name : Build bindist
211- if : needs.configuration.outputs.test-arm64 == 'true'
212- shell : bash
213- run : |
214- # Stack's project-level configuration (stack.yaml) specifies the
215- # multi-architecture (including Linux/Aarch64) Docker image published by
216- # Oliver Benz (@benz0li, on GitHub). That image comes with Stack 2.11.1.
217- # (Note that the online documentation for '--docker-stack-exe image'
218- # specifies that the host Stack and image Stack must have the same
219- # version number.)
220- /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 run --install --stack=recommended -- stack --allow-different-user etc/scripts/release.hs build --allow-dirty --alpine --build-args --docker-stack-exe=image
221176
222- - name : Upload bindist
223- if : needs.configuration.outputs.test-arm64 == 'true'
224- uses : actions/upload-artifact@v4
225- with :
226- name : Linux-ARM64
227- 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-*
228211
229212 github-release :
230213 name : Create GitHub release
231214 permissions :
232215 contents : write
233216 needs :
234- - configuration
235217 - integration-tests
236218 - linux-arm64
237219 runs-on : ubuntu-latest
@@ -258,27 +240,25 @@ jobs:
258240 name : Windows-X64
259241 path : _release
260242 - name : Download Linux/AArch64 artifact
261- if : needs.configuration.outputs.test-arm64 == 'true'
262243 uses : actions/download-artifact@v4
263244 with :
264245 name : Linux-ARM64
265246 path : _release
247+ - name : Download FreeBSD/X64 artifact
248+ uses : actions/download-artifact@v4
249+ with :
250+ name : FreeBSD-X64
251+ path : _release
266252 - name : Hash and sign assets
267- if : needs.configuration.outputs.can-sign == 'true'
268253 shell : bash
269- env :
270- RELEASE_SIGNING_KEY : ${{ secrets.RELEASE_SIGNING_KEY }}
271254 run : |
272255 set -e
273- echo "$RELEASE_SIGNING_KEY"|gpg --import
274256 cd _release
275257 for asset in *; do
276258 shasum -a 256 "$asset" >"$asset.sha256"
277- gpg --digest-algo=sha512 --detach-sig --armor -u 0x575159689BEFB442 "$asset"
278259 done
279260 - name : Create GitHub release (final)
280261 id : github_release_final
281- if : " !startsWith(github.ref, 'refs/tags/rc/')"
282262 uses : ncipollo/release-action@v1.13.0
283263 env :
284264 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
@@ -295,19 +275,7 @@ jobs:
295275 [INSERT CONTRIBUTORS]
296276 draft : true
297277 prerelease : false
298- - name : Create GitHub release (release candidate)
299- id : github_release_rc
300- if : " startsWith(github.ref, 'refs/tags/rc/')"
301- uses : ncipollo/release-action@v1.13.0
302- env :
303- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
304- with :
305- body : |
306- **Changes since v[INSERT PREVIOUS VERSION]:**
307278
308- [INSERT CHANGELOG]
309- draft : true
310- prerelease : true
311279 - name : Upload assets to GitHub release (final)
312280 if : " !startsWith(github.ref, 'refs/tags/rc/')"
313281 uses : xresloader/upload-to-github-release@v1
@@ -319,14 +287,3 @@ jobs:
319287 prerelease : false
320288 overwrite : true
321289 release_id : ${{ steps.github_release_final.outputs.id }}
322- - name : Upload assets to GitHub release (release candidate)
323- if : " startsWith(github.ref, 'refs/tags/rc/')"
324- uses : xresloader/upload-to-github-release@v1
325- env :
326- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
327- with :
328- file : " _release/*"
329- draft : true
330- prerelease : true
331- overwrite : true
332- release_id : ${{ steps.github_release_rc.outputs.id }}
0 commit comments