CI: don't use --test-option with older cabal versions (< 3).

This commit is contained in:
John MacFarlane 2021-02-28 16:01:38 -08:00
parent 36456070c4
commit dd56822006

View file

@ -95,10 +95,11 @@ jobs:
- name: Build and test
run: |
v2=$([ "${{ matrix.versions.cabal }}" = "2.2" ] && printf 'new' || printf 'v2')
testopts=$([ "${{ matrix.versions.cabal }}" != "2.2" ] && [ "${{ matrix.versions.cabal }}" != "2.4" ] && printf '--test-option=--hide-successes')
cabal $v2-build --enable-tests --disable-optimization 2>&1 | tee build.log
# fail if warnings in local build
! grep -q ": *[Ww]arning:" build.log || exit 1
cabal $v2-test --disable-optimization --test-option=--hide-successes
cabal $v2-test --disable-optimization $testopts
windows: