Merge PR #998 #364
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: [ 'master', 'ci' ] | |
pull_request: | |
branches: [ 'master' ] | |
jobs: | |
stack: | |
name: Stack | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
stack: ["latest"] | |
args: | |
- "--resolver nightly --stack-yaml stack-nightly.yaml" | |
- "--resolver lts-22" | |
- "--resolver lts-21 --stack-yaml stack-lts-21.yaml" | |
- "--resolver lts-20 --stack-yaml stack-lts-20.yaml" | |
- "--resolver lts-19 --stack-yaml stack-lts-19.yaml" | |
- "--resolver lts-18 --stack-yaml stack-lts-18.yaml" | |
exclude: | |
- os: "macos-latest" | |
args: "--resolver lts-19 --stack-yaml stack-lts-19.yaml" | |
- os: "macos-latest" | |
args: "--resolver lts-18 --stack-yaml stack-lts-18.yaml" | |
steps: | |
- name: Clone project | |
uses: actions/checkout@v4 | |
# Not sure how to have GHC not setup twice | |
# Something with settings "ghc-version"? | |
# ["9.8", "9.6", "9.4", "9.2", "9.0", "8.10"] | |
- uses: haskell-actions/setup@v2 | |
name: Setup Haskell Stack | |
with: | |
stack-version: ${{ matrix.stack }} | |
enable-stack: true | |
# Getting weird OS X errors... | |
# - name: Cache dependencies | |
# uses: actions/cache@v1 | |
# with: | |
# path: ~/.stack | |
# key: ${{ runner.os }}-${{ matrix.resolver }}-${{ hashFiles('stack.yaml') }} | |
# restore-keys: | | |
# ${{ runner.os }}-${{ matrix.resolver }}- | |
- name: Build and run tests | |
shell: bash | |
run: | | |
set -ex | |
EXTRA="" | |
BENCH="--bench" | |
if [[ ${{ matrix.os }} = "windows-latest" ]] | |
then | |
EXTRA="--no-run-tests" | |
elif [[ ${{ matrix.os }} = "macos-latest" ]] | |
then | |
BENCH="" | |
fi | |
stack test --no-terminal ${{ matrix.args }} --haddock --no-haddock-deps $BENCH --no-run-benchmarks $EXTRA |