From eb80184ab16bcb1bccce9cc814c09a4eb5d5056e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Choutri?= Date: Tue, 30 Jul 2024 21:37:42 +0200 Subject: [PATCH] Try something naive --- .cirrus.yml | 12 +++++++++++- .cirrus/ci.sh | 22 ++++++++++++++++++---- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index a9b5cad..d9964e2 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -3,5 +3,15 @@ task: freebsd_instance: image_family: freebsd-14-0 install_script: pkg install -y ghc hs-cabal-install git autoconf bash + setup_script: + - ./.cirrus/ci.sh setup_freebsd + - ./.cirrus/ci.sh configure_freebsd + haskell_cache: + folder: ~/.cabal/store + fingerprint_script: + - export PLAN_HASH=$(sha256sum ./dist-newstyle/cache/plan.json | awk '{print $1}') + - echo "ghc-9.8.2-$PLAN_HASH" + script: - - ./.cirrus/ci.sh build_freebd + - ./.cirrus/ci.sh build_freebsd + - ./.cirrus/ci.sh test_freebsd diff --git a/.cirrus/ci.sh b/.cirrus/ci.sh index 18ba687..75d80be 100755 --- a/.cirrus/ci.sh +++ b/.cirrus/ci.sh @@ -2,7 +2,7 @@ set -xEeuo pipefail -build_freebsd() { +setup_freebsd() { export GHCUP_INSTALL_BASE_PREFIX="/opt/ghc/" mkdir -p ~/.local/ghcup/bin/ curl -L https://downloads.haskell.org/~ghcup/x86_64-portbld-freebsd-ghcup --output /opt/ghcup/bin/ghcup @@ -10,14 +10,28 @@ build_freebsd() { ghcup install ghc 9.8.2 ghcup set ghc 9.8.2 ghcup install cabal 3.12.1.0 + cabal update +} + +configure_freebsd() { + cabal freeze --project-file=cabal.release.project +} + +build_freebsd() { + cabal build --project-file=cabal.release.project all -j +} + +test_freebsd() { + cabal test --project-file=cabal.release.project all -j } help() { - echo "Run with \`build_freebsd\`" + echo "Run with setup_freebsd, configure_freebsd, build_freebsd or test_freebsd." } case ${1:-help} in help) help ;; - build_frebsd) build_freebsd ;; - + setup_freebsd) setup_freebsd ;; + build_freebsd) build_freebsd ;; + test_freebsd) test_freebsd ;; esac