diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 6291a43..1489466 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -8,9 +8,9 @@ # # For more information, see https://github.com/haskell-CI/haskell-ci # -# version: 0.11.20201223 +# version: 0.11.20201228 # -# REGENDATA ("0.11.20201223",["github","--config=cabal.haskell-ci","cabal.project"]) +# REGENDATA ("0.11.20201228",["github","--config=cabal.haskell-ci","cabal.project"]) # name: Haskell-CI on: @@ -145,6 +145,15 @@ jobs: rm -f cabal-plan.xz chmod a+x $HOME/.cabal/bin/cabal-plan cabal-plan --version + - name: install cabal-docspec + run: | + mkdir -p $HOME/.cabal/bin + curl -sL https://oleg.fi/cabal-docspec-0.0.0.20201228.xz > cabal-docspec.xz + echo 'edf15d3a0b46fc57fb1bdb0ae5e87abdc5c3b7dfff8655a958ef038d4c2f17ab cabal-docspec.xz' | sha256sum -c - + xz -d < cabal-docspec.xz > $HOME/.cabal/bin/cabal-docspec + rm -f cabal-docspec.xz + chmod a+x $HOME/.cabal/bin/cabal-docspec + cabal-docspec --version - name: checkout uses: actions/checkout@v2 with: @@ -194,9 +203,10 @@ jobs: - name: build run: | $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always - - name: tests + - name: docspec run: | - $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all + if [ $((HCNUMVER >= 70800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all ; fi + if [ $((HCNUMVER >= 70800)) -ne 0 ] ; then cabal-docspec $ARG_COMPILER ; fi - name: cabal check run: | cd ${PKGDIR_comonad} || false diff --git a/Setup.lhs b/Setup.lhs index faedcd3..ef6602c 100644 --- a/Setup.lhs +++ b/Setup.lhs @@ -1,34 +1,6 @@ \begin{code} -{-# LANGUAGE CPP #-} -{-# OPTIONS_GHC -Wall #-} module Main (main) where - -#ifndef MIN_VERSION_cabal_doctest -#define MIN_VERSION_cabal_doctest(x,y,z) 0 -#endif - -#if MIN_VERSION_cabal_doctest(1,0,0) - -import Distribution.Extra.Doctest ( defaultMainWithDoctests ) -main :: IO () -main = defaultMainWithDoctests "doctests" - -#else - -#ifdef MIN_VERSION_Cabal --- If the macro is defined, we have new cabal-install, --- but for some reason we don't have cabal-doctest in package-db --- --- Probably we are running cabal sdist, when otherwise using new-build --- workflow -import Warning () -#endif - -import Distribution.Simple - +import Distribution.Simple (defaultMain) main :: IO () main = defaultMain - -#endif - \end{code} diff --git a/Warning.hs b/Warning.hs deleted file mode 100644 index a5a14a9..0000000 --- a/Warning.hs +++ /dev/null @@ -1,5 +0,0 @@ -module Warning - {-# WARNING ["You are configuring this package without cabal-doctest installed.", - "The doctests test-suite will not work as a result.", - "To fix this, install cabal-doctest before configuring."] #-} - () where diff --git a/cabal.haskell-ci b/cabal.haskell-ci index 17bdf46..dfb10b2 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -5,13 +5,5 @@ irc-channels: irc.freenode.org#haskell-lens irc-if-in-origin-repo: True -- Work around https://github.com/haskell/haddock/issues/242 haddock: <7.6 || >=7.8 - --- Because we use a custom Setup script, --test-show-details can only support --- the options that come with the version of Cabal that is linked against. --- Unfortunately, --test-show-details=direct wasn't introduced until --- Cabal-1.24.*, and GHC 7.10 and earlier ship with an older version of Cabal --- than that. As a result, trying to pass --test-show-details=direct won't work --- on these GHC versions unless we rebuild Cabal from scratch, which is --- time-consuming. As a result, we simply disable --test-show-details=direct --- as a quick-but-dirty workaround. -test-output-direct: False +-- :{ ... :} are problematic for older GHCis +docspec: >=7.8 diff --git a/comonad.cabal b/comonad.cabal index fa65fa5..20b970a 100644 --- a/comonad.cabal +++ b/comonad.cabal @@ -13,7 +13,7 @@ copyright: Copyright (C) 2008-2014 Edward A. Kmett, Copyright (C) 2004-2008 Dave Menendez synopsis: Comonads description: Comonads. -build-type: Custom +build-type: Simple tested-with: GHC == 7.0.4 , GHC == 7.2.2 , GHC == 7.4.2 @@ -34,18 +34,6 @@ extra-source-files: README.markdown CHANGELOG.markdown examples/History.hs - Warning.hs - -custom-setup - setup-depends: - base >= 4 && < 5, - Cabal, - cabal-doctest >= 1 && < 1.1 - --- You can disable the doctests test suite with -f-test-doctests -flag test-doctests - default: True - manual: True flag containers description: @@ -129,18 +117,3 @@ library FunctionalDependencies FlexibleInstances UndecidableInstances - -test-suite doctests - type: exitcode-stdio-1.0 - default-language: Haskell2010 - main-is: doctests.hs - ghc-options: -Wall -threaded - hs-source-dirs: tests - - if !flag(test-doctests) - buildable: False - else - build-depends: - base, - comonad, - doctest >= 0.11.1 && < 0.18 diff --git a/tests/doctests.hs b/tests/doctests.hs deleted file mode 100644 index 2d080e7..0000000 --- a/tests/doctests.hs +++ /dev/null @@ -1,25 +0,0 @@ ------------------------------------------------------------------------------ --- | --- Module : Main (doctests) --- Copyright : (C) 2012-14 Edward Kmett --- License : BSD-style (see the file LICENSE) --- Maintainer : Edward Kmett --- Stability : provisional --- Portability : portable --- --- This module provides doctests for a project based on the actual versions --- of the packages it was built with. It requires a corresponding Setup.lhs --- to be added to the project ------------------------------------------------------------------------------ -module Main where - -import Build_doctests (flags, pkgs, module_sources) -import Data.Foldable (traverse_) -import Test.DocTest - -main :: IO () -main = do - traverse_ putStrLn args - doctest args - where - args = flags ++ pkgs ++ module_sources