Skip to content

Run filesystem event tests without hspec #8168

Run filesystem event tests without hspec

Run filesystem event tests without hspec #8168

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 }}
# For updating see: https://downloads.haskell.org/~ghcup/
GHCUP_VERSION: 0.1.20.0
DOCSPEC_URL: https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20210111/cabal-docspec-0.0.0.20210111.xz
DOCSPEC_OPTIONS: "--timeout 60 --check-properties --property-variables xs"
GHCUP_GHC_OPTIONS: ${{ matrix.ghcup_ghc_options }}
GHCVER: ${{ matrix.ghc_version }}
CABALVER: ${{ matrix.cabal_version }}
DISABLE_DOCS: ${{ matrix.disable_docs }}
ENABLE_DOCSPEC: ${{ matrix.enable_docspec }}
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 }}
# CABAL_TEST_OPTIONS: -j1
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: "./packcheck.sh"
PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck"
PACKCHECK_GITHUB_COMMIT: "7c4e1ab7a59b5ed6e92cfd0da67460a6116be4ac"
# Pull token from "secrets" setting of the github repo
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
COVERAGE: ${{ matrix.coverage }}
# hlint
HLINT_VERSION: 3.6.1
HLINT_OPTIONS: "lint"
HLINT_TARGETS: "core/src src test benchmark"
# 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.2.8
# - 9.8.1-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: 9.2.8
ghc_version: 9.2.8
runner: ubuntu-latest
build: cabal
cabal_project: cabal.project
cabal_version: 3.6.2.0
disable_sdist_build: "y"
ignore_error: false
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
name: Cache common directories
with:
path: |
~/.local
~/.cabal
~/.stack
~/.ghcup
# Bump the key version to clear the cache
key: ${{ runner.os }}-${{ matrix.ghc_version }}-cabal-v2
- name: Download packcheck
run: |
if test ! -e "$PACKCHECK"
then
if test -z "$PACKCHECK_GITHUB_COMMIT"
then
die "PACKCHECK_GITHUB_COMMIT is not specified."
fi
PACKCHECK_URL=${PACKCHECK_GITHUB_URL}/${PACKCHECK_GITHUB_COMMIT}/packcheck.sh
curl --fail -sL -o "$PACKCHECK" $PACKCHECK_URL || exit 1
chmod +x $PACKCHECK
elif test ! -x "$PACKCHECK"
then
chmod +x $PACKCHECK
fi
- name: Run tests
run: |
if 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
# /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" "$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
echo
echo "------------file systems--------------"
case `uname` in
Linux)
df -T
echo "-----------"
cat /proc/mounts ;;
Darwin)
df -Y ;;
*) die "Unknown OS [$os]" ;;
esac
echo "--------------------------------------"
echo
bash -c "$PACKCHECK $BUILD"
fi