Re-enable doctests on CI

This commit is contained in:
Gaël Deest 2021-03-16 10:23:23 +01:00
parent 613dcf9ed5
commit 133ed94442

View file

@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, macOS-latest] os: [ubuntu-latest]
cabal: ["3.2"] cabal: ["3.2"]
ghc: ghc:
- "8.8.4" - "8.8.4"
@ -40,6 +40,7 @@ jobs:
- name: Configure - name: Configure
run: | run: |
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
cabal install --ignore-project -j2 doctest --constraint='doctest ^>=0.17'
- name: Freeze - name: Freeze
run: | run: |
@ -59,6 +60,30 @@ jobs:
run: | run: |
cabal test all cabal test all
- name: Run doctests
run: |
# Necessary for doctest to be found in $PATH
export PATH="$HOME/.cabal/bin:$PATH"
# Filter out base-compat-batteries from .ghc.environment.*, as its modules
# conflict with those of base-compat.
#
# FIXME: This is an ugly hack. Ultimately, we'll want to use cabal-doctest
# (or cabal v2-doctest, if it ever lands) to provide a clean GHC environment.
# This might allow running doctests in GHCJS build as well.
perl -i -e 'while (<ARGV>) { print unless /package-id\s+(base-compat-batteries)-\d+(\.\d+)*/; }' .ghc.environment.*
(cd servant && doctest src)
(cd servant-client && doctest src)
(cd servant-client-core && doctest src)
(cd servant-http-streams && doctest src)
(cd servant-docs && doctest src)
(cd servant-foreign && doctest src)
(cd servant-server && doctest src)
(cd servant-machines && doctest src)
(cd servant-conduit && doctest src)
(cd servant-pipes && doctest src)
stack: stack:
name: stack / ghc ${{ matrix.ghc }} name: stack / ghc ${{ matrix.ghc }}
runs-on: ubuntu-latest runs-on: ubuntu-latest