Skip to content

Build streamly with ghc-9.6.1 #6699

Build streamly with ghc-9.6.1

Build streamly with ghc-9.6.1 #6699

Workflow file for this run

name: Haskell CI
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: GHC ${{matrix.name}}
env:
# packcheck environment variables
LC_ALL: C.UTF-8
BUILD: ${{ matrix.build }}
GHCVER: ${{ matrix.ghc_version }}
CABALVER: ${{ matrix.cabal_version }}
DISABLE_DOCS: ${{ matrix.disable_docs }}
DISABLE_TEST: ${{ matrix.disable_test }}
DISABLE_BENCH: ${{ matrix.disable_bench }}
DISABLE_DIST_CHECKS: ${{ matrix.disable_dist_checks }}
SDIST_OPTIONS: ${{ matrix.sdist_options }}
DISABLE_SDIST_BUILD: ${{ matrix.disable_sdist_build }}
# Cabal options
CABAL_REINIT_CONFIG: y
# Github has machines with 2 CPUS and 6GB memory so the cabal jobs
# default (ncpus) is good, this can be checked from the packcheck
# output in case it changes.
CABAL_BUILD_OPTIONS: ${{ matrix.cabal_build_options }} --flag limit-build-mem
CABAL_BUILD_TARGETS: ${{ matrix.cabal_build_targets }}
CABAL_PROJECT: ${{ matrix.cabal_project }}
CABAL_CHECK_RELAX: y
# Stack options
STACK_UPGRADE: "y"
RESOLVER: ${{ matrix.resolver }}
STACK_YAML: ${{ matrix.stack_yaml }}
STACK_BUILD_OPTIONS: ${{ matrix.stack_build_options }}
# packcheck location and revision
PACKCHECK_LOCAL_PATH: "./packcheck.sh"
PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck"
PACKCHECK_GITHUB_COMMIT: "a302772c8f3791c477edd1764b82f8d1f5b22fdf"
# Pull token from "secrets" setting of the github repo
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
COVERAGE: ${{ matrix.coverage }}
DOCTEST: ${{ matrix.doctest }}
# Subdir
SUBDIR: ${{ matrix.subdir }}
runs-on: ${{ matrix.runner }}
continue-on-error: ${{ matrix.ignore_error }}
strategy:
fail-fast: true
matrix:
# The order is important to optimize fail-fast.
name:
- 9.4.4-Werror
- 9.2.7-docspec
# - 8.10.7-coverage
# Note: if cabal.project is not specified benchmarks and tests won't
# run. But we need at least one test where we test without
# cabal.project because that is how hackage would build it.
include:
- name: head
ghc_version: head
runner: ubuntu-latest
build: cabal
cabal_version: 3.8.1.0
cabal_project: cabal.project.ghc-head
disable_sdist_build: "y"
ignore_error: true
- name: 9.6.1
ghc_version: 9.6.1
runner: ubuntu-latest
build: cabal
cabal_version: 3.10.1.0
disable_sdist_build: "y"
cabal_project: cabal.project
ignore_error: true
- name: 9.4.4-Werror
ghc_version: 9.4.4
runner: ubuntu-latest
build: cabal
cabal_version: 3.8.1.0
disable_sdist_build: "y"
cabal_project: cabal.project.Werror
ignore_error: false
- name: 9.4.4-fusion-inspection
ghc_version: 9.4.4
runner: ubuntu-latest
build: cabal
cabal_version: 3.8.1.0
disable_sdist_build: "y"
cabal_project: cabal.project
cabal_build_options: "--flag fusion-plugin --flag inspection"
ignore_error: false
- name: 9.2.7
ghc_version: 9.2.7
runner: ubuntu-latest
build: cabal
cabal_project: cabal.project
cabal_version: 3.6.2.0
disable_sdist_build: "y"
ignore_error: false
- name: 9.2.7-docspec
ghc_version: 9.2.7
runner: ubuntu-latest
doctest: "y"
cabal_version: 3.6.2.0
cabal_project: cabal.project
disable_sdist_build: "y"
ignore_error: false
- name: 9.0.2-streamly-sdist
ghc_version: 9.0.2
runner: ubuntu-latest
build: cabal
cabal_version: 3.6.2.0
cabal_project: cabal.project.streamly
ignore_error: true
- name: 9.0.2-streamly-core-sdist
ghc_version: 9.0.2
runner: ubuntu-latest
build: cabal
cabal_version: 3.6.2.0
subdir: core
ignore_error: false
- name: 8.10.7-streamly-sdist-stack
runner: ubuntu-latest
build: stack
resolver: lts-20.13
stack_yaml: stack.yaml
sdist_options: "--ignore-check"
stack_build_options: "--flag streamly-benchmarks:-opt"
cabal_version: 3.6.2.0
ignore_error: false
- name: 8.10.7-macos
ghc_version: 8.10.7
runner: macos-latest
build: cabal
cabal_version: 3.6.2.0
cabal_project: cabal.project
disable_sdist_build: "y"
ignore_error: false
# - name: 8.10.7-coverage
# ghc_version: 8.10.7
# runner: ubuntu-latest
# coverage: "y"
# cabal_version: 3.6.2.0
# ignore_error: false
- name: 8.8.4
ghc_version: 8.8.4
runner: ubuntu-latest
build: cabal
cabal_version: 3.6.2.0
cabal_project: cabal.project
disable_sdist_build: "y"
ignore_error: false
- name: 8.6.5-no-fusion-unoptimized
ghc_version: 8.6.5
runner: ubuntu-latest
build: cabal
cabal_version: 3.6.2.0
cabal_project: cabal.project
cabal_build_options: "--flag no-fusion --flag -opt"
disable_sdist_build: "y"
ignore_error: false
- name: 8.6.5-debug-unoptimized
ghc_version: 8.6.5
runner: ubuntu-latest
build: cabal
cabal_version: 3.6.2.0
cabal_project: cabal.project
cabal_build_options: "--flag debug --flag -opt"
disable_sdist_build: "y"
ignore_error: false
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
name: Cache ~/.cabal
with:
path: ~/.cabal
# Bump the key version to clear the cache
key: ${{ runner.os }}-${{ matrix.ghc_version }}-cabal-v2
- name: Download packcheck
run: |
# Get packcheck if needed
CURL=$(which curl)
PACKCHECK_URL=${PACKCHECK_GITHUB_URL}/${PACKCHECK_GITHUB_COMMIT}/packcheck.sh
if test ! -e "$PACKCHECK_LOCAL_PATH"; then $CURL -sL -o "$PACKCHECK_LOCAL_PATH" $PACKCHECK_URL; fi;
chmod +x $PACKCHECK_LOCAL_PATH
os=$(uname -s -m)
case "$os" in
"Linux x86_64") GHCUP_ARCH="x86_64-linux" ;;
"Darwin x86_64") GHCUP_ARCH="x86_64-apple-darwin" ;;
*) echo "Unknown OS/Arch: $os"; exit 1;;
esac
# Check available versions here: https://downloads.haskell.org/~ghcup/
GHCUP_VER=0.1.18.0
$CURL -sL -o ./ghcup https://downloads.haskell.org/~ghcup/$GHCUP_VER/${GHCUP_ARCH}-ghcup-$GHCUP_VER
chmod +x ./ghcup
if test "$GHCVER" = "head"
then
# The URL may change, to find a working URL go to https://gitlab.haskell.org/ghc/ghc/-/jobs/
# Find a debian10 job, click on a passed/failed job, at the
# end of the output you will find the tar.xz name, put that after
# "raw/", and put the job name after "job=".
# Also see https://github.com/mpickering/ghc-artefact-nix/blob/master/gitlab-artifact.nix
./ghcup install ghc -u https://gitlab.haskell.org/ghc/ghc/-/jobs/artifacts/master/raw/ghc-x86_64-linux-deb10-int_native-validate.tar.xz?job=x86_64-linux-deb10-int_native-validate head
else
./ghcup install ghc $GHCVER
fi
./ghcup install cabal $CABALVER
./ghcup set ghc $GHCVER
./ghcup set cabal $CABALVER
- name: Run tests
run: |
if test -n "$DOCTEST"
then
mkdir -p $HOME/.cabal/bin
curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20210111/cabal-docspec-0.0.0.20210111.xz > cabal-docspec.xz
echo '0829bd034fba901cbcfe491d98ed8b28fd54f9cb5c91fa8e1ac62dc4413c9562 cabal-docspec.xz' | sha256sum -c -
xz -d < cabal-docspec.xz > $HOME/.cabal/bin/cabal-docspec
rm -f cabal-docspec.xz
chmod a+x $HOME/.cabal/bin/cabal-docspec
cabal update
cabal build --project-file cabal.project.doctest all
$HOME/.cabal/bin/cabal-docspec --version
$HOME/.cabal/bin/cabal-docspec --timeout 60 --check-properties --property-variables xs
elif test -n "$COVERAGE"
then
# Run tests with coverage
cabal update
# Build hpc-coveralls if needed
sudo apt-get install -y libcurl4-gnutls-dev
export PATH=$HOME/.cabal/bin:$PATH
which hpc-coveralls 2>/dev/null || cabal install --project-file cabal.project.hpc-coveralls hpc-coveralls
# Run tests and upload results to coveralls.io
bin/test.sh --coverage --raw
# XXX Uncomment this and fix it properly later
# hpc-coveralls --repo-token="$COVERALLS_TOKEN" --coverage-mode=StrictlyFullLines
else
export TOOLS_DIR=/opt
# /usr/local/opt/curl/bin for macOS
export PATH=$HOME/.local/bin:$HOME/.ghcup/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/opt/curl/bin
if test -n "$SUBDIR"
then
mv "$PACKCHECK_LOCAL_PATH" "$SUBDIR/packcheck.sh"
# This is required as dist-newstyle will be created on the top level
# directory as it is considered the working dir.
rm cabal.project
cd "$SUBDIR"
fi
bash -c "$PACKCHECK_LOCAL_PATH $BUILD"
fi