Skip to content

Commit b3f896c

Browse files
Add a FreeBSD CI based on github vmactions
1 parent cc40b53 commit b3f896c

1 file changed

Lines changed: 88 additions & 0 deletions

File tree

.github/workflows/freebsd.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# FreeBSD CI
2+
#
3+
# FreeBSD is not a native GitHub Actions runner, so this workflow runs
4+
# the build inside a VM via vmactions/freebsd-vm. It is kept separate
5+
# from haskell.yml because the cache/restore step model in that
6+
# workflow (hackage index, ghcup, deps caches) does not apply inside
7+
# the VM.
8+
9+
name: FREEBSD
10+
11+
on:
12+
workflow_dispatch:
13+
pull_request:
14+
push:
15+
branches:
16+
- master
17+
18+
jobs:
19+
build:
20+
name: >-
21+
freebsd-${{ matrix.release }}
22+
${{ matrix.command }}
23+
${{ matrix.ghc_version }}
24+
runs-on: ubuntu-latest
25+
continue-on-error: ${{ matrix.ignore_error }}
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
include:
30+
- release: "14.3"
31+
command: cabal
32+
ghc_version: 9.14.1
33+
ignore_error: true
34+
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
- name: Build on FreeBSD
39+
uses: vmactions/freebsd-vm@v1
40+
env:
41+
PACKCHECK_COMMAND: ${{ matrix.command }}
42+
GHCVER: ${{ matrix.ghc_version }}
43+
# For updating see: https://downloads.haskell.org/~ghcup/
44+
GHCUP_VERSION: 0.1.50.2
45+
LC_ALL: C.UTF-8
46+
CABAL_REINIT_CONFIG: y
47+
CABAL_CHECK_RELAX: y
48+
CABAL_PROJECT: cabal.project
49+
DISABLE_BENCH: "y"
50+
DISABLE_DOCS: "y"
51+
DISABLE_SDIST_BUILD: "y"
52+
DISABLE_DIST_CHECKS: "y"
53+
PACKCHECK: "./packcheck.sh"
54+
PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck"
55+
PACKCHECK_GITHUB_COMMIT: "b3743510c7c26f83254ffd9ef91bcd71560cff05"
56+
with:
57+
release: ${{ matrix.release }}
58+
usesh: true
59+
copyback: false
60+
envs: >-
61+
PACKCHECK_COMMAND GHCVER GHCUP_VERSION LC_ALL
62+
CABAL_REINIT_CONFIG CABAL_CHECK_RELAX CABAL_PROJECT
63+
DISABLE_BENCH DISABLE_DOCS DISABLE_SDIST_BUILD DISABLE_DIST_CHECKS
64+
PACKCHECK PACKCHECK_GITHUB_URL PACKCHECK_GITHUB_COMMIT
65+
prepare: |
66+
pkg update
67+
pkg install -y gmake
68+
pkg install -y bash
69+
pkg install -y git
70+
run: |
71+
if test ! -e "$PACKCHECK"
72+
then
73+
if test -z "$PACKCHECK_GITHUB_COMMIT"
74+
then
75+
echo "PACKCHECK_GITHUB_COMMIT is not specified." >&2
76+
exit 1
77+
fi
78+
PACKCHECK_URL=${PACKCHECK_GITHUB_URL}/${PACKCHECK_GITHUB_COMMIT}/packcheck.sh
79+
curl --fail -sL -o "$PACKCHECK" $PACKCHECK_URL || exit 1
80+
chmod +x $PACKCHECK
81+
elif test ! -x "$PACKCHECK"
82+
then
83+
chmod +x $PACKCHECK
84+
fi
85+
# Use "bash -c" instead of invoking directly to preserve quoted
86+
# arguments in PACKCHECK_COMMAND e.g. DOCSPEC_OPTIONS="--timeout 60".
87+
# Direct invocation would word-split on spaces inside quoted values.
88+
bash -c "$PACKCHECK $PACKCHECK_COMMAND"

0 commit comments

Comments
 (0)