on master help sign in
Re-enable doctests on CI
133ed94Gaël Deest
.github/workflows/main.yml+26−1
@@ -12,7 +12,7 @@ jobs:
12 runs-on: ${{ matrix.os }}
12 runs-on: ${{ matrix.os }}
13 strategy:
13 strategy:
14 matrix:
14 matrix:
15− os: [ubuntu-latest, macOS-latest]
15+ os: [ubuntu-latest]
16 cabal: ["3.2"]
16 cabal: ["3.2"]
17 ghc:
17 ghc:
18 - "8.8.4"
18 - "8.8.4"
@@ -40,6 +40,7 @@ jobs:
40 - name: Configure
40 - name: Configure
41 run: |
41 run: |
42 cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
42 cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
43+ cabal install --ignore-project -j2 doctest --constraint='doctest ^>=0.17'
43
44
44 - name: Freeze
45 - name: Freeze
45 run: |
46 run: |
@@ -59,6 +60,30 @@ jobs:
59 run: |
60 run: |
60 cabal test all
61 cabal test all
61
62
63+ - name: Run doctests
64+ run: |
65+ # Necessary for doctest to be found in $PATH
66+ export PATH="$HOME/.cabal/bin:$PATH"
67+
68+ # Filter out base-compat-batteries from .ghc.environment.*, as its modules
69+ # conflict with those of base-compat.
70+ #
71+ # FIXME: This is an ugly hack. Ultimately, we'll want to use cabal-doctest
72+ # (or cabal v2-doctest, if it ever lands) to provide a clean GHC environment.
73+ # This might allow running doctests in GHCJS build as well.
74+ perl -i -e 'while (<ARGV>) { print unless /package-id\s+(base-compat-batteries)-\d+(\.\d+)*/; }' .ghc.environment.*
75+
76+ (cd servant && doctest src)
77+ (cd servant-client && doctest src)
78+ (cd servant-client-core && doctest src)
79+ (cd servant-http-streams && doctest src)
80+ (cd servant-docs && doctest src)
81+ (cd servant-foreign && doctest src)
82+ (cd servant-server && doctest src)
83+ (cd servant-machines && doctest src)
84+ (cd servant-conduit && doctest src)
85+ (cd servant-pipes && doctest src)
86+
62 stack:
87 stack:
63 name: stack / ghc ${{ matrix.ghc }}
88 name: stack / ghc ${{ matrix.ghc }}
64 runs-on: ubuntu-latest
89 runs-on: ubuntu-latest