on master help sign in
Add script for running doctest and enable it for GHC 9.0 (#19)
commit85fe6ca42798ff2bdf13a3d41aba12db22394895 authorAndrzej Rybczak <arybczak@users.noreply.github.com> dateThu 8 Jul 2021, 18:45 (5 years ago) parent8b82309
3 files changed+39−8
.github/workflows/haskell-ci.yml+9−7 cabal.haskell-ci+1−1 doctest.sh+29
.github/workflows/haskell-ci.yml+9−7
@@ -8,9 +8,9 @@
88#
99# For more information, see https://github.com/haskell-CI/haskell-ci
1010#
11−# version: 0.13.20210606
11+# version: 0.13.20210621
1212#
13−# REGENDATA ("0.13.20210606",["github","--config=cabal.haskell-ci","effectful.cabal"])
13+# REGENDATA ("0.13.20210621",["github","--config=cabal.haskell-ci","effectful.cabal"])
1414#
1515name: Haskell-CI
1616on:
@@ -148,7 +148,7 @@ jobs:
148148 - name: cache (tools)
149149 uses: actions/cache@v2
150150 with:
151− key: ${{ runner.os }}-${{ matrix.compiler }}-tools-60139de7
151+ key: ${{ runner.os }}-${{ matrix.compiler }}-tools-b692a344
152152 path: ~/.haskell-ci-tools
153153 - name: install cabal-plan
154154 run: |
@@ -161,8 +161,8 @@ jobs:
161161 cabal-plan --version
162162 - name: install doctest
163163 run: |
164− if [ $((HCNUMVER < 90000)) -ne 0 ] ; then $CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.17' ; fi
165− if [ $((HCNUMVER < 90000)) -ne 0 ] ; then doctest --version ; fi
164+ if [ $((HCNUMVER < 90200)) -ne 0 ] ; then $CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.18' ; fi
165+ if [ $((HCNUMVER < 90200)) -ne 0 ] ; then doctest --version ; fi
166166 - name: checkout
167167 uses: actions/checkout@v2
168168 with:
@@ -223,8 +223,10 @@ jobs:
223223 $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
224224 - name: doctest
225225 run: |
226− if [ $((HCNUMVER < 90000)) -ne 0 ] ; then cd ${PKGDIR_effectful} || false ; fi
227− if [ $((HCNUMVER < 90000)) -ne 0 ] ; then doctest -XBangPatterns -XConstraintKinds -XDataKinds -XFlexibleContexts -XFlexibleInstances -XGADTs -XGeneralizedNewtypeDeriving -XLambdaCase -XMultiParamTypeClasses -XRankNTypes -XRecordWildCards -XRoleAnnotations -XScopedTypeVariables -XStrictData -XTupleSections -XTypeApplications -XTypeFamilies -XTypeOperators src ; fi
226+ if [ $((HCNUMVER < 90200)) -ne 0 ] ; then cd ${PKGDIR_effectful} || false ; fi
227+ if [ $((HCNUMVER < 90200)) -ne 0 ] ; then doctest -XBangPatterns -XConstraintKinds -XDataKinds -XFlexibleContexts -XFlexibleInstances -XGADTs -XGeneralizedNewtypeDeriving -XLambdaCase -XMultiParamTypeClasses -XNoStarIsType -XRankNTypes -XRecordWildCards -XRoleAnnotations -XScopedTypeVariables -XStrictData -XTupleSections -XTypeApplications -XTypeFamilies -XTypeOperators src ; fi
228+ if [ $((HCNUMVER < 90200)) -ne 0 ] ; then cd ${PKGDIR_effectful} || false ; fi
229+ if [ $((HCNUMVER < 90200)) -ne 0 ] ; then doctest -XBangPatterns -XConstraintKinds -XDataKinds -XFlexibleContexts -XFlexibleInstances -XGADTs -XGeneralizedNewtypeDeriving -XLambdaCase -XMultiParamTypeClasses -XNoStarIsType -XRankNTypes -XRecordWildCards -XRoleAnnotations -XScopedTypeVariables -XStrictData -XTupleSections -XTypeApplications -XTypeFamilies -XTypeOperators utils ; fi
228230 - name: cabal check
229231 run: |
230232 cd ${PKGDIR_effectful} || false
cabal.haskell-ci+1−1
@@ -1,6 +1,6 @@
11branches: master
22
3−doctest: <9
3+doctest: <9.2
44tests: True
55benchmarks: True
66
doctest.shnew file+29
@@ -0,0 +1,29 @@
1+#!/bin/sh
2+#
3+# For this to work you need to:
4+#
5+# - Put "write-ghc-environment-files: always" in your cabal.project.local.
6+#
7+# - Compile doctest with the same GHC version the project currently uses.
8+#
9+
10+doctest src \
11+ -XBangPatterns \
12+ -XConstraintKinds \
13+ -XDataKinds \
14+ -XFlexibleContexts \
15+ -XFlexibleInstances \
16+ -XGADTs \
17+ -XGeneralizedNewtypeDeriving \
18+ -XLambdaCase \
19+ -XMultiParamTypeClasses \
20+ -XNoStarIsType \
21+ -XRankNTypes \
22+ -XRecordWildCards \
23+ -XRoleAnnotations \
24+ -XScopedTypeVariables \
25+ -XStrictData \
26+ -XTupleSections \
27+ -XTypeApplications \
28+ -XTypeFamilies \
29+ -XTypeOperators