Skip to content

Commit

Permalink
Use self-hosted FreeBSD runners
Browse files Browse the repository at this point in the history
  • Loading branch information
hasufell committed Mar 22, 2024
1 parent cd74aa7 commit 0c504bb
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
31 changes: 31 additions & 0 deletions .github/scripts/env.sh
Original file line number Diff line number Diff line change
@@ -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

27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0c504bb

Please sign in to comment.