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 30, 2020
1 parent 713d1a9 commit 7047353
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 88 deletions.
19 changes: 16 additions & 3 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.20201227
# version: 0.11.20201230
#
# REGENDATA ("0.11.20201227",["github","--config=cabal.haskell-ci","cabal.project"])
# REGENDATA ("0.11.20201230",["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://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20201230.1/cabal-docspec-0.0.0.20201230.1.xz > cabal-docspec.xz
echo '18caf4f361fadd978782f08e78f42d21d4f177567419055ffccae19b8214852d 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 @@ -191,7 +200,11 @@ jobs:
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
- name: tests
run: |
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
- name: docspec
run: |
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all
cabal-docspec $ARG_COMPILER
- name: cabal check
run: |
cd ${PKGDIR_distributive} || false
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.markdown
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.6.2.1 [202y.mm.d]
-------------------
* Use `build-type: Simple`

0.6.2 [2020.04.10]
------------------
* Make the `Distributive` instance for `Tagged` poly-kinded.
Expand Down
31 changes: 1 addition & 30 deletions Setup.lhs
Original file line number Diff line number Diff line change
@@ -1,34 +1,5 @@
\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.

11 changes: 1 addition & 10 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,4 @@ unconstrained: False
allow-failures: <7.3
irc-channels: irc.freenode.org#haskell-lens
irc-if-in-origin-repo: True

-- 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
docspec: True
17 changes: 2 additions & 15 deletions distributive.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: distributive
category: Data Structures
version: 0.6.2
version: 0.6.2.1
license: BSD3
cabal-version: >= 1.10
license-file: LICENSE
Expand All @@ -12,7 +12,7 @@ bug-reports: http://github.com/ekmett/distributive/issues
copyright: Copyright (C) 2011-2016 Edward A. Kmett
synopsis: Distributive functors -- Dual to Traversable
description: Distributive functors -- Dual to @Traversable@
build-type: Custom
build-type: Simple
tested-with: GHC == 7.0.4
, GHC == 7.2.2
, GHC == 7.4.2
Expand All @@ -31,7 +31,6 @@ extra-source-files:
config
CHANGELOG.markdown
README.markdown
Warning.hs

source-repository head
type: git
Expand Down Expand Up @@ -95,18 +94,6 @@ library

default-language: Haskell2010

-- Verify the results of the examples
test-suite doctests
type: exitcode-stdio-1.0
main-is: doctests.hs
build-depends:
base >= 4,
distributive,
doctest >= 0.11.1 && <0.18
ghc-options: -Wall -threaded
hs-source-dirs: tests
default-language: Haskell2010

test-suite spec
type: exitcode-stdio-1.0
hs-source-dirs: tests
Expand Down
25 changes: 0 additions & 25 deletions tests/doctests.hs

This file was deleted.

0 comments on commit 7047353

Please sign in to comment.