Skip to content

Rewrite release CI

Rewrite release CI #1

name: Build and release
on:
workflow_call:
inputs:
branches:
required: true
type: string
ghc:
type: string
default: 9.6.7
# speed up installation by skipping docs
# starting with GHC 9.10.x, we also need to pass the 'install_extra' target
ghc_targets:
type: string
default: "install_bin install_lib update_package_db"
gmp:
type: string
default: 6.3.0
cabal:
type: string
default: 3.14.2.0
env:
GHC_VERSION: ${{ inputs.ghc }}
GHC_TARGETS: ${{ inputs.ghc_targets }}
CABAL_VERSION: ${{ inputs.cabal }}
GMP_VERSION: ${{ inputs.gmp }}
DEBIAN_FRONTEND: noninteractive
TZ: Asia/Singapore
jobs:
tool-output:
runs-on: ubuntu-latest
outputs:
apt_tools: ${{ steps.gen_output.outputs.apt_tools }}
apt_tools_ncurses6: ${{ steps.gen_output.outputs.apt_tools_ncurses6 }}
rpm_tools: ${{ steps.gen_output.outputs.rpm_tools }}
apk_tools: ${{ steps.gen_output.outputs.apk_tools }}
xbps_tools: ${{ steps.gen_output.outputs.xbps_tools }}
env:
APT: "groff-base libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev patchelf"
RPM: "groff-base autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf"
APK: "groff binutils-gold curl gcc g++ gmp-dev libc-dev libffi-dev make musl-dev ncurses-dev perl tar xz autoconf automake bzip2 coreutils elfutils-dev findutils git jq bzip2-dev patch python3 sqlite sudo wget which zlib-dev patchelf zlib zlib-dev zlib-static"
XBPS: "groff ncurses-libtinfo-libs autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils findutils gcc gmp gmp-devel jq lbzip2 make ncurses ncurses-devel openssh patch perl python3 sqlite sudo wget which xz tar zlib-devel patchelf gzip"
steps:
- name: Generate output
id: gen_output
run: |
echo apt_tools="${{ env.APT }} libncurses5 libtinfo5" >> "$GITHUB_OUTPUT"
echo apt_tools_ncurses6="${{ env.APT }} libncurses6 libtinfo6" >> "$GITHUB_OUTPUT"
echo rpm_tools="${{ env.RPM }}" >> "$GITHUB_OUTPUT"
echo apk_tools="${{ env.APK }}" >> "$GITHUB_OUTPUT"
echo xbps_tools="${{ env.XBPS }}" >> "$GITHUB_OUTPUT"
build-linux:
name: Build linux binaries
runs-on: ubuntu-latest
needs: ["tool-output"]
env:
TARBALL_EXT: tar.xz
ARCH: 64
strategy:
fail-fast: false
matrix:
branch: ${{ fromJSON(inputs.branches) }}

Check failure on line 66 in .github/workflows/reusable-release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/reusable-release.yml

Invalid workflow file

You have an error in your yaml syntax on line 66
platform: [ { image: "rockylinux:8"
, installCmd: "yum -y install epel-release && yum install -y --allowerasing"
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
, DISTRO: "Rockylinux"
, ARTIFACT: "x86_64-linux-glibc"
, ADD_CABAL_ARGS: "--enable-split-sections"
},
{ image: "alpine:3.20"
, installCmd: "apk update && apk add"
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
, DISTRO: "Alpine"
, ARTIFACT: "x86_64-linux-musl"
, ADD_CABAL_ARGS: "--enable-split-sections"
}
{ image: "alpine:3.20"
, installCmd: "apk update && apk add"
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
, DISTRO: "Alpine"
, ARTIFACT: "x86_64-linux-musl-static"
, ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static"
}
]
container:
image: ${{ matrix.platform.image }}
steps:
- name: Install requirements
shell: sh
run: |
${{ matrix.platform.installCmd }} curl bash git ${{ matrix.platform.toolRequirements }}
- name: Install GHCup
uses: haskell/ghcup-setup@v1
with:
cabal: ${{ env.CABAL_VERSION }}
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- if: matrix.platform.DISTRO == 'Rockylinux'
run: |
curl -O -L https://gmplib.org/download/gmp/gmp-${{ env.GMP_VERSION }}.tar.xz
tar xf gmp-${{ env.GMP_VERSION }}.tar.xz
cd gmp-${{ env.GMP_VERSION }}
./configure --prefix=$HOME/.local/ --disable-shared
make install
echo "extra-lib-dirs: $HOME/.local/lib/" >> cabal.release.project.local
- name: Run build
run: |
bash .github/scripts/build.sh
env:
ARTIFACT: ${{ matrix.platform.ARTIFACT }}
DISTRO: ${{ matrix.platform.DISTRO }}
ADD_CABAL_ARGS: ${{ matrix.platform.ADD_CABAL_ARGS }}
- if: always()
name: Upload artifact
uses: ./.github/actions/upload
with:
if-no-files-found: error
retention-days: 2
name: artifacts-${{ matrix.platform.ARTIFACT }}-${{ matrix.branch }}
path: |
./out/*
build-linux-32bit:
name: Build linux binaries (32bit)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
branch: ${{ fromJSON(inputs.branches) }}
env:
TARBALL_EXT: tar.xz
ARCH: 32
DISTRO: "Unknown"
ARTIFACT: "i386-linux-unknown"
ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static"
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: Run build (32 bit linux)
uses: docker://hasufell/i386-alpine-haskell:3.21
with:
args: sh -c "export PATH=$HOME/.ghcup/bin:$PATH && bash .github/scripts/build.sh"
- if: always()
name: Upload artifact
uses: ./.github/actions/upload
with:
if-no-files-found: error
retention-days: 2
name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }}
path: |
./out/*
build-arm:
name: Build ARM binary
runs-on: ubuntu-22.04-arm
env:
TARBALL_EXT: tar.xz
ADD_CABAL_ARGS: ""
ARCH: ARM64
strategy:
fail-fast: false
matrix:
branch: ${{ fromJSON(inputs.branches) }}
platform: [ { ARCH: "ARM64"
, DISTRO: "Debian"
, ARTIFACT: "aarch64-linux-deb10"
},
{ ARCH: "ARM64"
, DISTRO: "Alpine"
, ARTIFACT: "aarch64-linux-alpine"
}
]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- if: matrix.platform.DISTRO == 'Debian'
uses: docker://hasufell/arm64v8-debian-haskell:11
name: Run build (aarch64 linux)
with:
args: sh -c "export PATH=$HOME/.ghcup/bin:$PATH && bash .github/scripts/build.sh"
env:
ARTIFACT: ${{ matrix.platform.ARTIFACT }}
DISTRO: ${{ matrix.platform.DISTRO }}
ADD_CABAL_ARGS: ""
- if: matrix.platform.DISTRO == 'Alpine'
uses: docker://hasufell/arm64v8-alpine-haskell:3.21
name: Run build (aarch64 linux alpine)
with:
args: sh -c "export PATH=$HOME/.ghcup/bin:$PATH && bash .github/scripts/build.sh"
env:
ARTIFACT: ${{ matrix.platform.ARTIFACT }}
DISTRO: ${{ matrix.platform.DISTRO }}
ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static"
- if: always()
name: Upload artifact
uses: ./.github/actions/upload
with:
if-no-files-found: error
retention-days: 2
name: artifacts-${{ matrix.platform.ARTIFACT }}-${{ matrix.branch }}
path: |
./out/*
build-mac-x86_64:
name: Build binary (Mac x86_64)
runs-on: macOS-13
env:
MACOSX_DEPLOYMENT_TARGET: 10.13
ADD_CABAL_ARGS: ""
ARTIFACT: "x86_64-apple-darwin"
ARCH: 64
TARBALL_EXT: tar.xz
DISTRO: na
strategy:
fail-fast: false
matrix:
branch: ${{ fromJSON(inputs.branches) }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: Install GHCup
uses: haskell/ghcup-setup@v1
with:
cabal: ${{ env.CABAL_VERSION }}
- name: Run build
run: |
brew install coreutils tree
bash .github/scripts/build.sh
- if: always()
name: Upload artifact
uses: ./.github/actions/upload
with:
if-no-files-found: error
retention-days: 2
name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }}
path: |
./out/*
build-mac-aarch64:
name: Build binary (Mac aarch64)
runs-on: macos-latest
env:
MACOSX_DEPLOYMENT_TARGET: 10.13
ADD_CABAL_ARGS: ""
ARTIFACT: "aarch64-apple-darwin"
ARCH: ARM64
TARBALL_EXT: tar.xz
DISTRO: na
HOMEBREW_CHANGE_ARCH_TO_ARM: 1
GHCUP_INSTALL_BASE_PREFIX: ${{ github.workspace }}
strategy:
fail-fast: false
matrix:
branch: ${{ fromJSON(inputs.branches) }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: Install GHCup
uses: haskell/ghcup-setup@v1
with:
cabal: ${{ env.CABAL_VERSION }}
- name: Run build
run: |
brew install git coreutils autoconf automake tree
bash .github/scripts/build.sh
- if: always()
name: Upload artifact
uses: ./.github/actions/upload
with:
if-no-files-found: error
retention-days: 2
name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }}
path: |
./out/*
build-win:
name: Build binary (Win)
runs-on: windows-latest
env:
ADD_CABAL_ARGS: ""
ARTIFACT: "x86_64-mingw64"
ARCH: 64
TARBALL_EXT: "zip"
DISTRO: na
CABAL_DIR: "C:\\Users\\runneradmin\\AppData\\Roaming\\cabal"
GHCUP_INSTALL_BASE_PREFIX: "/c"
strategy:
fail-fast: false
matrix:
branch: ${{ fromJSON(inputs.branches) }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: install windows deps
shell: pwsh
run: |
C:\msys64\usr\bin\bash -lc "pacman --disable-download-timeout --noconfirm -Syuu"
C:\msys64\usr\bin\bash -lc "pacman --disable-download-timeout --noconfirm -Syuu"
C:\msys64\usr\bin\bash -lc "pacman --disable-download-timeout --noconfirm -S make mingw-w64-x86_64-clang curl autoconf mingw-w64-x86_64-pkgconf ca-certificates base-devel gettext autoconf make libtool automake python p7zip patch unzip zip git"
taskkill /F /FI "MODULES eq msys-2.0.dll"
- name: Install GHCup
uses: haskell/ghcup-setup@v1
with:
cabal: ${{ env.CABAL_VERSION }}
- name: Run build (windows)
run: |
$env:CHERE_INVOKING = 1
$env:MSYS2_PATH_TYPE = "inherit"
$ErrorActionPreference = "Stop"
C:\msys64\usr\bin\bash -lc "bash .github/scripts/build.sh"
shell: pwsh
- if: always()
name: Upload artifact
uses: ./.github/actions/upload
with:
if-no-files-found: error
retention-days: 2
name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }}
path: |
./out/*
build-freebsd-x86_64:
name: Build FreeBSD x86_64
runs-on: [self-hosted, FreeBSD, X64]
env:
ADD_CABAL_ARGS: ""
ARTIFACT: "x86_64-portbld-freebsd"
ARCH: 64
TARBALL_EXT: tar.xz
DISTRO: na
RUNNER_OS: FreeBSD
CABAL_DIR: ${{ github.workspace }}/.cabal
GHCUP_INSTALL_BASE_PREFIX: ${{ github.workspace }}
strategy:
fail-fast: false
matrix:
branch: ${{ fromJSON(inputs.branches) }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: Install GHCup
uses: haskell/ghcup-setup@v1
with:
cabal: ${{ env.CABAL_VERSION }}
- name: Run build
run: |
sudo sed -i.bak -e 's/quarterly/latest/' /etc/pkg/FreeBSD.conf
sudo pkg install -y ghc hs-cabal-install git bash misc/compat10x misc/compat11x misc/compat12x gmake llvm14 libiconv
sudo tzsetup Etc/GMT
sudo adjkerntz -a
bash .github/scripts/build.sh
- if: always()
name: Upload artifact
uses: ./.github/actions/upload
with:
if-no-files-found: error
retention-days: 2
name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }}
path: |
./out/*
test-linux:
name: Test linux binaries
runs-on: ubuntu-latest
needs: ["tool-output", "build-linux"]
env:
TARBALL_EXT: tar.xz
ARCH: 64
ADD_CABAL_ARGS: ""
strategy:
fail-fast: false
matrix:
branch: ${{ fromJSON(inputs.branches) }}
platform: [ { image: "debian:11"
, installCmd: "apt-get update && apt-get install -y"
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
, DISTRO: "Debian"
, ARTIFACT: "x86_64-linux-glibc"
},
{ image: "debian:12"
, installCmd: "apt-get update && apt-get install -y"
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
, DISTRO: "Debian"
, ARTIFACT: "x86_64-linux-glibc"
},
{ image: "ubuntu:20.04"
, installCmd: "apt-get update && apt-get install -y"
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
, DISTRO: "Ubuntu"
, ARTIFACT: "x86_64-linux-glibc"
},
{ image: "ubuntu:22.04"
, installCmd: "apt-get update && apt-get install -y"
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
, DISTRO: "Ubuntu"
, ARTIFACT: "x86_64-linux-glibc"
},
{ image: "ubuntu:24.04"
, installCmd: "apt-get update && apt-get install -y"
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools_ncurses6 }}"
, DISTRO: "Ubuntu"
, ARTIFACT: "x86_64-linux-glibc"
},
{ image: "linuxmintd/mint20.3-amd64"
, installCmd: "apt-get update && apt-get install -y"
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
, DISTRO: "Mint"
, ARTIFACT: "x86_64-linux-glibc"
},
{ image: "linuxmintd/mint21.3-amd64"
, installCmd: "apt-get update && apt-get install -y"
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
, DISTRO: "Mint"
, ARTIFACT: "x86_64-linux-glibc"
},
{ image: "fedora:33"
, installCmd: "dnf install -y"
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
, DISTRO: "Fedora"
, ARTIFACT: "x86_64-linux-glibc"
},
{ image: "fedora:37"
, installCmd: "dnf install -y"
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
, DISTRO: "Fedora"
, ARTIFACT: "x86_64-linux-glibc"
},
{ image: "fedora:42"
, installCmd: "dnf install -y"
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
, DISTRO: "Fedora"
, ARTIFACT: "x86_64-linux-glibc"
},
{ image: "rockylinux:8"
, installCmd: "yum -y install epel-release && yum install -y --allowerasing"
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
, DISTRO: "Rockylinux"
, ARTIFACT: "x86_64-linux-glibc"
},
{ image: "rockylinux:9"
, installCmd: "yum -y install epel-release && yum install -y --allowerasing"
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
, DISTRO: "Rockylinux"
, ARTIFACT: "x86_64-linux-glibc"
},
{ image: "alpine:3.20"
, installCmd: "apk update && apk add"
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
, DISTRO: "Alpine"
, ARTIFACT: "x86_64-linux-musl-static"
},
{ image: "alpine:3.12"
, installCmd: "apk update && apk add"
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
, DISTRO: "Alpine"
, ARTIFACT: "x86_64-linux-musl-static"
},
{ image: "alpine:3.20"
, installCmd: "apk update && apk add"
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
, DISTRO: "Alpine"
, ARTIFACT: "x86_64-linux-musl"
},
{ image: "alpine:3.12"
, installCmd: "apk update && apk add"
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
, DISTRO: "Alpine"
, ARTIFACT: "x86_64-linux-musl"
},
{ image: "ghcr.io/void-linux/void-glibc:latest"
, installCmd: "xbps-install -Suy xbps && xbps-install -Sy"
, toolRequirements: "${{ needs.tool-output.outputs.xbps_tools }}"
, DISTRO: "Unknown"
, ARTIFACT: "x86_64-linux-musl-static"
}
]
container:
image: ${{ matrix.platform.image }}
steps:
- name: Install requirements
shell: sh
run: |
${{ matrix.platform.installCmd }} curl bash git ${{ matrix.platform.toolRequirements }}
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: git clone fix
run: git config --system --add safe.directory $GITHUB_WORKSPACE
- name: Install GHCup
uses: haskell/ghcup-setup@v1
with:
cabal: ${{ env.CABAL_VERSION }}
- uses: ./.github/actions/download
with:
name: artifacts-${{ matrix.platform.ARTIFACT }}-${{ matrix.branch }}
path: ./out
- name: Run test
run: |
bash .github/scripts/test.sh
env:
ARTIFACT: ${{ matrix.platform.ARTIFACT }}
DISTRO: ${{ matrix.platform.DISTRO }}
ADD_CABAL_ARGS: ${{ matrix.platform.ADD_CABAL_ARGS }}
# test-linux-32bit:
# name: Test linux binaries (32bit)
# runs-on: ubuntu-latest
# needs: ["build-linux-32bit"]
# env:
# TARBALL_EXT: tar.xz
# ARCH: 32
# DISTRO: "Unknown"
# ARTIFACT: "i386-linux-unknown"
# ADD_CABAL_ARGS: ""
# strategy:
# fail-fast: false
# matrix:
# branch: ${{ fromJSON(inputs.branches) }}
# steps:
# - uses: actions/checkout@v4
# with:
# ref: ${{ matrix.branch }}
#
# - uses: ./.github/actions/download
# with:
# name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }}
# path: ./out
#
# - name: Run build (32 bit linux)
# uses: docker://hasufell/i386-alpine-haskell:3.21
# with:
# args: sh -c "apk update && apk add groff && git config --system --add safe.directory $GITHUB_WORKSPACE && export PATH=$HOME/.ghcup/bin:$PATH && bash .github/scripts/test.sh"
test-arm:
name: Test ARM binary
runs-on: ubuntu-22.04-arm
needs: ["build-arm"]
env:
ADD_CABAL_ARGS: ""
TARBALL_EXT: tar.xz
ARCH: ARM64
strategy:
fail-fast: false
matrix:
branch: ${{ fromJSON(inputs.branches) }}
platform: [ { ARCH: "ARM64"
, DISTRO: "Debian"
, ARTIFACT: "aarch64-linux-deb10"
},
{ ARCH: "ARM64"
, DISTRO: "Alpine"
, ARTIFACT: "aarch64-linux-alpine"
}
]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- uses: ./.github/actions/download
with:
name: artifacts-${{ matrix.platform.ARTIFACT }}-${{ matrix.branch }}
path: ./out
- if: matrix.platform.DISTRO == 'Debian'
uses: docker://hasufell/arm64v8-debian-haskell:11
name: Run build (aarch64 linux)
with:
args: sh -c "git config --system --add safe.directory $GITHUB_WORKSPACE && apt-get update && apt-get install -y groff-base && export PATH=$HOME/.ghcup/bin:$PATH && bash .github/scripts/test.sh"
env:
ARTIFACT: ${{ matrix.platform.ARTIFACT }}
DISTRO: ${{ matrix.platform.DISTRO }}
- if: matrix.platform.DISTRO == 'Alpine'
uses: docker://hasufell/arm64v8-alpine-haskell:3.21
name: Run build (aarch64 linux alpine)
with:
args: sh -c "git config --system --add safe.directory $GITHUB_WORKSPACE && apk update && apk add groff && export PATH=$HOME/.ghcup/bin:$PATH && bash .github/scripts/test.sh"
env:
ARTIFACT: ${{ matrix.platform.ARTIFACT }}
DISTRO: ${{ matrix.platform.DISTRO }}
test-mac-x86_64:
name: Test binary (Mac x86_64)
runs-on: macOS-13
needs: ["build-mac-x86_64"]
env:
ADD_CABAL_ARGS: ""
MACOSX_DEPLOYMENT_TARGET: 10.13
ARTIFACT: "x86_64-apple-darwin"
ARCH: 64
TARBALL_EXT: tar.xz
DISTRO: na
strategy:
fail-fast: false
matrix:
branch: ${{ fromJSON(inputs.branches) }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- uses: ./.github/actions/download
with:
name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }}
path: ./out
- name: Install GHCup
uses: haskell/ghcup-setup@v1
with:
cabal: ${{ env.CABAL_VERSION }}
- name: Run test
run: |
brew install git coreutils autoconf automake tree
bash .github/scripts/test.sh
test-mac-aarch64:
name: Test binary (Mac aarch64)
runs-on: macos-latest
needs: ["build-mac-aarch64"]
env:
ADD_CABAL_ARGS: ""
MACOSX_DEPLOYMENT_TARGET: 10.13
ARTIFACT: "aarch64-apple-darwin"
ARCH: ARM64
TARBALL_EXT: tar.xz
DISTRO: na
HOMEBREW_CHANGE_ARCH_TO_ARM: 1
GHCUP_INSTALL_BASE_PREFIX: ${{ github.workspace }}
strategy:
fail-fast: false
matrix:
branch: ${{ fromJSON(inputs.branches) }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- uses: ./.github/actions/download
with:
name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }}
path: ./out
- name: Install GHCup
uses: haskell/ghcup-setup@v1
with:
cabal: ${{ env.CABAL_VERSION }}
- name: Run test
run: |
brew install git coreutils autoconf automake tree
bash .github/scripts/test.sh
test-win:
name: Test binary (Win)
runs-on: windows-latest
needs: ["build-win"]
env:
ADD_CABAL_ARGS: ""
ARTIFACT: "x86_64-mingw64"
ARCH: 64
TARBALL_EXT: "zip"
DISTRO: na
CABAL_DIR: "C:\\Users\\runneradmin\\AppData\\Roaming\\cabal"
GHCUP_INSTALL_BASE_PREFIX: "/c"
strategy:
fail-fast: false
matrix:
branch: ${{ fromJSON(inputs.branches) }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: install windows deps
shell: pwsh
run: |
C:\msys64\usr\bin\bash -lc "pacman --disable-download-timeout --noconfirm -Syuu"
C:\msys64\usr\bin\bash -lc "pacman --disable-download-timeout --noconfirm -Syuu"
C:\msys64\usr\bin\bash -lc "pacman --disable-download-timeout --noconfirm -S make mingw-w64-x86_64-clang curl autoconf mingw-w64-x86_64-pkgconf ca-certificates base-devel gettext autoconf make libtool automake python p7zip patch unzip zip git"
taskkill /F /FI "MODULES eq msys-2.0.dll"
- uses: ./.github/actions/download
with:
name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }}
path: ./out
- name: Install GHCup
uses: haskell/ghcup-setup@v1
with:
cabal: ${{ env.CABAL_VERSION }}
- name: Run test (windows)
run: |
$env:CHERE_INVOKING = 1
$env:MSYS2_PATH_TYPE = "inherit"
$ErrorActionPreference = "Stop"
C:\msys64\usr\bin\bash -lc "bash .github/scripts/test.sh"
shell: pwsh
test-freebsd-x86_64:
name: Test FreeBSD x86_64
runs-on: [self-hosted, FreeBSD, X64]
needs: ["build-freebsd-x86_64"]
env:
ADD_CABAL_ARGS: ""
ARTIFACT: "x86_64-portbld-freebsd"
ARCH: 64
TARBALL_EXT: tar.xz
DISTRO: na
RUNNER_OS: FreeBSD
CABAL_DIR: ${{ github.workspace }}/.cabal
GHCUP_INSTALL_BASE_PREFIX: ${{ github.workspace }}
strategy:
fail-fast: false
matrix:
branch: ${{ fromJSON(inputs.branches) }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- uses: ./.github/actions/download
with:
name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }}
path: ./out
- name: Install GHCup
uses: haskell/ghcup-setup@v1
with:
cabal: ${{ env.CABAL_VERSION }}
- name: Run test
run: |
sudo sed -i.bak -e 's/quarterly/latest/' /etc/pkg/FreeBSD.conf
sudo pkg install -y ghc hs-cabal-install git bash misc/compat10x misc/compat11x misc/compat12x gmake llvm14 libiconv groff autoconf automake
sudo tzsetup Etc/GMT
sudo adjkerntz -a
bash .github/scripts/test.sh