Skip to content

Commit

Permalink
Use cabal-docspec
Browse files Browse the repository at this point in the history
... make package build-type: Simple
  • Loading branch information
phadej committed Dec 28, 2020
1 parent a46edae commit 00621ca
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 101 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
30 changes: 1 addition & 29 deletions Setup.lhs
Original file line number Diff line number Diff line change
@@ -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}
5 changes: 0 additions & 5 deletions Warning.hs

This file was deleted.

12 changes: 2 additions & 10 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
Expand Up @@ -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
29 changes: 1 addition & 28 deletions comonad.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
25 changes: 0 additions & 25 deletions tests/doctests.hs

This file was deleted.

0 comments on commit 00621ca

Please sign in to comment.