From 53244da3330ada568f80e2a07b4c6fe7268c91fc Mon Sep 17 00:00:00 2001 From: Steve Hart Date: Fri, 25 Mar 2022 15:43:50 -0400 Subject: Fix CI (#1467) * CI: Reinstall GHC with docs CI tests were failing because the GHC preinstalled to the CI environment does not include documentation, which is required for running the Haddock tests. This commit causes the CI workflow to reinstall GHC with docs so that tests can succeed. --- .github/workflows/ci.yml | 15 +- cabal.project | 176 --------------------- haddock-library/haddock-library.cabal | 4 +- .../test/Documentation/Haddock/Parser/UtilSpec.hs | 3 + html-test/ref/Bug574.html | 2 +- html-test/ref/ConstructorArgs.html | 2 +- hypsrc-test/ref/src/LinkingIdentifiers.html | 2 +- 7 files changed, 20 insertions(+), 184 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9268c6b7..c147cbdc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,6 @@ jobs: steps: - uses: actions/checkout@v2 - if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/ghc-9.2' - uses: haskell/actions/setup@v1 id: setup-haskell-cabal @@ -28,9 +27,19 @@ jobs: ghc-version: ${{ matrix.ghc }} cabal-version: ${{ matrix.cabal }} - - name: Prepare environment - run: echo "$HOME/.ghcup/bin" >> $GITHUB_PATH + # GitHub preinstalls recent GHC versions, and haskell/actions/setup uses the + # preinstalled version when possible. However, GitHub's preinstalled GHC does + # not include documentation, and we need documentation to run Haddock tests. + # Therefore, we reinstall GHC to ensure that we have the documentation we + # need. + # TODO: Only reinstall GHC when the docs are actually missing. (If we're + # using a GHC version that is not preinstalled by GitHub, then we will be + # using a GHC installed by ghcup, which should have documentation.) + - name: Reinstall GHC with docs + run: | + ghcup rm ghc ${{ matrix.ghc }} + ghcup install ghc ${{ matrix.ghc }} - name: Freeze run: | diff --git a/cabal.project b/cabal.project index 87aca679..bf964dda 100644 --- a/cabal.project +++ b/cabal.project @@ -3,22 +3,8 @@ packages: ./ ./haddock-library ./haddock-test -with-compiler: ghc-9.2 - active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override -allow-newer: - Cabal, - base, - binary, - bytestring, - ghc, - ghc-prim, - integer-gmp, - template-haskell, - text, - time - repository head.hackage.ghc.haskell.org url: https://ghc.gitlab.haskell.org/head.hackage/ secure: True @@ -27,165 +13,3 @@ repository head.hackage.ghc.haskell.org f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89 26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d - -constraints: - Cabal ==2.4.1.0 || ==3.0.2.0 || ==3.2.1.0, - EdisonAPI ==1.3.1, - EdisonCore ==1.3.2.1, - FPretty ==1.1, - HTTP ==4000.3.16, - HUnit ==1.6.2.0, - QuickCheck ==2.14.2, - Spock-core ==0.14.0.0, - active ==0.2.0.14, - aeson ==1.5.6.0, - aivika ==5.9.1, - aivika-transformers ==5.9.1, - alex ==3.2.6, - ansi-pretty ==0.1.2.2, - arith-encode ==1.0.2, - attoparsec ==0.13.2.5 || ==0.14.2, - barbies ==2.0.2.0, - barbies-th ==0.1.8, - base-compat ==0.11.2, - base-compat-batteries ==0.11.2, - base16-bytestring ==1.0.1.0, - basement ==0.0.12, - bits ==0.5.3, - blaze-builder ==0.4.2.1, - boomerang ==1.4.7, - bound ==2.0.3, - box-tuples ==0.2.0.4, - byteslice ==0.2.5.2, - bytesmith ==0.3.7.0, - bytestring-strict-builder ==0.4.5.4, - cabal-doctest ==1.0.8, - cantor-pairing ==0.2.0.1, - cassava ==0.5.2.0, - cborg ==0.2.5.0, - cereal ==0.5.8.1, - charset ==0.3.9, - chaselev-deque ==0.5.0.5, - colour ==2.3.5, - combinat ==0.2.10.0, - commonmark-extensions ==0.2.0.4, - conduit ==1.3.4.1, - constraints ==0.13, - constraints-extras ==0.3.1.0, - cql ==4.0.3, - critbit ==0.2.0.0, - cryptonite ==0.28 || ==0.29, - data-default-instances-new-base ==0.0.2, - data-dword ==0.3.2, - data-r-tree ==0.6.0, - deferred-folds ==0.9.17, - deriving-compat ==0.5.10, - diagrams-lib ==1.4.3, - doctest ==0.16.3 || ==0.18.1, - drinkery ==0.4, - emacs-module ==0.1.1, - endo ==0.3.0.1, - entropy ==0.4.1.6, - enumeration ==0.2.0, - extra ==1.7.9, - fclabels ==2.0.5, - filepattern ==0.1.2, - focus ==1.0.2, - free-algebras ==0.1.0.1, - free-functors ==1.2.1, - generic-deriving ==1.14, - generic-lens ==2.1.0.0, - generic-lens-core ==2.1.0.0, - generic-optics ==2.1.0.0, - generics-sop ==0.5.1.1, - happy ==1.20.0, - hashtables ==1.2.4.1, - haskeline ==0.7.5.0, - haskell-src-exts ==1.23.1, - haskell-src-meta ==0.8.7, - heterocephalus ==1.0.5.4, - hgeometry ==0.11.0.0, - hgeometry-ipe ==0.11.0.0, - hspec-discover ==2.9.4, - hspec-expectations ==0.8.2, - hspec-meta ==2.7.8, - hspec-wai ==0.11.1, - http-types ==0.12.3, - http2 ==3.0.1, - hvect ==0.4.0.0, - hxt ==9.3.1.22, - inj-base ==0.2.0.0, - inspection-testing ==0.4.5.0, - integer-roots ==1.0, - invariant ==0.5.4, - io-choice ==0.0.7, - iproute ==1.7.11, - language-haskell-extract ==0.2.4, - lens ==4.19.2 || ==5.0.1, - lens-family-th ==0.5.2.0, - list-t ==1.0.4, - memory ==0.15.0 || ==0.16.0, - monad-validate ==1.2.0.0, - monadplus ==1.4.2, - mono-traversable ==1.0.15.1, - mono-traversable-keys ==0.1.0, - mustache ==2.3.1, - network ==3.1.2.1, - newtype-generics ==0.6, - numtype-dk ==0.5.0.2, - obdd ==0.8.2, - packman ==0.5.0, - pandoc ==2.13, - parameterized-utils ==2.1.3.0, - partial-isomorphisms ==0.2.2.1, - plots ==0.1.1.2, - pointed ==5.0.2, - posix-api ==0.3.4.0, - primitive ==0.7.3.0, - primitive-extras ==0.10.1, - primitive-sort ==0.1.0.0, - primitive-unlifted ==0.1.3.0, - proto3-wire ==1.2.2, - quickcheck-instances ==0.3.25.2, - random ==1.2.1, - row-types ==1.0.1.0, - safe ==0.3.19, - safecopy ==0.10.4.2, - salak ==0.3.6, - semialign ==1.2.0.1, - semigroupoids ==5.3.6, - serialise ==0.2.3.0, - servant ==0.18.2, - shake ==0.19.4, - shakespeare ==2.0.25, - singletons ==2.7 || ==3.0, - singletons-base ==3.0, - siphash ==1.0.3, - streaming-bytestring ==0.2.0, - streaming-commons ==0.2.2.1, - subcategories ==0.1.1.0, - tasty ==1.4.1, - test-framework ==0.8.2.0, - text-format ==0.3.2, - text-short ==0.1.3, - text-show ==3.9, - th-desugar ==1.11 || ==1.12, - tls ==1.5.5, - tpdb ==2.2.0, - tree-diff ==0.2.1.1, - true-name ==0.1.0.3, - uniplate ==1.6.13, - vector-builder ==0.3.8.1, - vector-circular ==0.1.3, - vector-th-unbox ==0.2.1.9, - vinyl ==0.13.3, - wai-extra ==3.1.6, - wai-middleware-static ==0.9.0, - warp ==3.3.15, - winery ==1.3.2, - witherable ==0.4.1, - x509-validation ==1.6.11, - xlsx ==0.8.3, - xml-hamlet ==0.5.0.1, - yaml ==0.11.5.0, - yesod-core ==1.6.20 diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal index a4a04309..a02df882 100644 --- a/haddock-library/haddock-library.cabal +++ b/haddock-library/haddock-library.cabal @@ -86,7 +86,7 @@ test-suite spec Documentation.Haddock.Parser.Identifier build-depends: - , base-compat ^>= 0.9.3 || ^>= 0.11.0 + , base-compat ^>= 0.12.0 , QuickCheck ^>= 2.11 || ^>= 2.13.2 || ^>= 2.14 , deepseq ^>= 1.3.0.0 || ^>= 1.4.0.0 @@ -113,7 +113,7 @@ test-suite fixtures , base -- extra dependencies - , base-compat ^>= 0.9.3 || ^>= 0.11.0 + , base-compat ^>= 0.12.0 , directory ^>= 1.3.0.2 , filepath ^>= 1.4.1.2 , optparse-applicative ^>= 0.15 diff --git a/haddock-library/test/Documentation/Haddock/Parser/UtilSpec.hs b/haddock-library/test/Documentation/Haddock/Parser/UtilSpec.hs index 10c701c7..2bb58fdf 100644 --- a/haddock-library/test/Documentation/Haddock/Parser/UtilSpec.hs +++ b/haddock-library/test/Documentation/Haddock/Parser/UtilSpec.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} module Documentation.Haddock.Parser.UtilSpec (main, spec) where @@ -5,7 +6,9 @@ import Documentation.Haddock.Parser.Monad import Documentation.Haddock.Parser.Util import Data.Either.Compat (isLeft) import Test.Hspec +#if !(MIN_VERSION_base(4,8,0)) import Control.Applicative +#endif main :: IO () main = hspec spec diff --git a/html-test/ref/Bug574.html b/html-test/ref/Bug574.html index 89f71a01..8264bfc0 100644 --- a/html-test/ref/Bug574.html +++ b/html-test/ref/Bug574.html @@ -84,7 +84,7 @@ >

Somthing with a spliced type

Something with a spliced type

Not bunded and no argument docs

Not bundled and no argument docs

-- Tests that the identifers/operators are properly linked even when:-- Tests that the identifiers/operators are properly linked even when: