Skip to content

Commit 405d90c

Browse files
committed
Try something naive
1 parent 836f1cd commit 405d90c

2 files changed

Lines changed: 33 additions & 6 deletions

File tree

.cirrus.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,16 @@ task:
33
freebsd_instance:
44
image_family: freebsd-14-0
55
install_script: pkg install -y ghc hs-cabal-install git autoconf bash
6+
setup_script:
7+
- export PATH=$HOME/.local/ghcup/bin:/opt/ghcup/bin:$PATH
8+
- ./.cirrus/ci.sh setup_freebsd
9+
- ./.cirrus/ci.sh configure_freebsd
10+
haskell_cache:
11+
folder: ~/.cabal/store
12+
fingerprint_script:
13+
- export PLAN_HASH=$(sha256sum ./dist-newstyle/cache/plan.json | awk '{print $1}')
14+
- echo "ghc-9.8.2-$PLAN_HASH"
15+
616
script:
7-
- ./.cirrus/ci.sh build_freebd
17+
- ./.cirrus/ci.sh build_freebsd
18+
- ./.cirrus/ci.sh test_freebsd

.cirrus/ci.sh

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,38 @@
22

33
set -xEeuo pipefail
44

5-
build_freebsd() {
5+
setup_freebsd() {
66
export GHCUP_INSTALL_BASE_PREFIX="/opt/ghc/"
7-
mkdir -p ~/.local/ghcup/bin/
7+
mkdir -p $HOME/.local/ghcup/bin/
8+
mkdir -p /opt/ghcup/bin/
9+
export PATH=$HOME/.local/ghcup/bin:/opt/ghcup/bin:$PATH
810
curl -L https://downloads.haskell.org/~ghcup/x86_64-portbld-freebsd-ghcup --output /opt/ghcup/bin/ghcup
911
chmod +x /opt/ghcup/bin/ghcup
1012
ghcup install ghc 9.8.2
1113
ghcup set ghc 9.8.2
1214
ghcup install cabal 3.12.1.0
15+
cabal update
16+
}
17+
18+
configure_freebsd() {
19+
cabal freeze --project-file=cabal.release.project
20+
}
21+
22+
build_freebsd() {
23+
cabal build --project-file=cabal.release.project all -j
24+
}
25+
26+
test_freebsd() {
27+
cabal test --project-file=cabal.release.project all -j
1328
}
1429

1530
help() {
16-
echo "Run with \`build_freebsd\`"
31+
echo "Run with setup_freebsd, configure_freebsd, build_freebsd or test_freebsd."
1732
}
1833

1934
case ${1:-help} in
2035
help) help ;;
21-
build_frebsd) build_freebsd ;;
22-
36+
setup_freebsd) setup_freebsd ;;
37+
build_freebsd) build_freebsd ;;
38+
test_freebsd) test_freebsd ;;
2339
esac

0 commit comments

Comments
 (0)