diff --git a/.cirrus.yml b/.cirrus.yml index 23ad931..28ce7d1 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,12 +1,12 @@ -task: - name: FreeBSD - freebsd_instance: - image_family: freebsd-13-2 - install_script: pkg install -y ghc hs-cabal-install git autoconf - script: - - cabal update - - autoreconf -i - - cabal test --test-show-details=direct +# task: +# name: FreeBSD +# freebsd_instance: +# image_family: freebsd-13-2 +# install_script: pkg install -y ghc hs-cabal-install git autoconf +# script: +# - cabal update +# - autoreconf -i +# - cabal test --test-show-details=direct task: name: OpenBSD diff --git a/.github/scripts/env.sh b/.github/scripts/env.sh new file mode 100755 index 0000000..dda1ee2 --- /dev/null +++ b/.github/scripts/env.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +if [ "${RUNNER_OS}" = "Windows" ] ; then + ext=".exe" +else + ext='' +fi + +export DEBIAN_FRONTEND=noninteractive +export TZ=Asia/Singapore + +export OS="$RUNNER_OS" +export PATH="$HOME/.local/bin:$PATH" + +if [ "${RUNNER_OS}" = "Windows" ] ; then + # on windows use pwd to get unix style path + CI_PROJECT_DIR="$(pwd)" + export CI_PROJECT_DIR + export GHCUP_INSTALL_BASE_PREFIX="/c" + export GHCUP_BIN="$GHCUP_INSTALL_BASE_PREFIX/ghcup/bin" + export PATH="$GHCUP_BIN:$PATH" + export CABAL_DIR="C:\\Users\\runneradmin\\AppData\\Roaming\\cabal" +else + export CI_PROJECT_DIR="${GITHUB_WORKSPACE}" + export GHCUP_INSTALL_BASE_PREFIX="$CI_PROJECT_DIR" + export GHCUP_BIN="$GHCUP_INSTALL_BASE_PREFIX/.ghcup/bin" + export PATH="$GHCUP_BIN:$PATH" + export CABAL_DIR="$CI_PROJECT_DIR/cabal" + export CABAL_CACHE="$CI_PROJECT_DIR/cabal-cache" +fi + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63a984e..70d2225 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -131,3 +131,30 @@ jobs: name: Run build (arm64v8 linux) with: args: sh -c "cabal update && autoreconf -i && cabal test all --test-show-details=direct" + + freebsd: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: [self-hosted, FreeBSD, X64] + ghc: 9.4.8 + - os: [self-hosted, FreeBSD, X64] + ghc: 9.6.4 + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Run build + run: | + pkg install -y curl gcc gmp gmake ncurses perl5 libffi libiconv git bash misc/compat10x misc/compat11x misc/compat12x gmake autoconf + . .github/scripts/env.sh + curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_INSTALL_NO_STACK=1 BOOTSTRAP_HASKELL_GHC_VERSION=${{ matrix.ghc }} BOOTSTRAP_HASKELL_ADJUST_BASHRC=yes sh + autoreconf --version + autoreconf -i + cabal sdist -z -o . + cabal get unix-*.tar.gz + cd unix-*/ + cabal test all --test-show-details=direct +