diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 43c6e7f7..4f93eeb4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macOS-latest] + os: [ubuntu-latest] cabal: ["3.2"] ghc: - "8.8.4" @@ -40,6 +40,7 @@ jobs: - name: Configure run: | cabal configure --enable-tests --enable-benchmarks --test-show-details=direct + cabal install --ignore-project -j2 doctest --constraint='doctest ^>=0.17' - name: Freeze run: | @@ -59,6 +60,30 @@ jobs: run: | 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 () { 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: name: stack / ghc ${{ matrix.ghc }} runs-on: ubuntu-latest