Skip to content

Commit

Permalink
ci: Only build haddock for hackage with the latest GHC
Browse files Browse the repository at this point in the history
Cabal 3.10.2.0 exposes a bug in Haddock shipped with GHC 9.0 and 9.2, so
we need to work around it by bumping the version of GHC/Haddock we use
for building/uploading docs to Hackage, and to prevent build failures we
don't ever try to build haddocks for Hackage with older versions of
GHC/Haddock.

Related: haskell/haddock#1582 (comment)
Related: haskell/cabal#8326
Related: haskell/cabal#9060
Related: haskell/cabal#9073
Related: haskell/cabal#9049
  • Loading branch information
liskin committed Nov 12, 2023
1 parent e38e19e commit 192c0da
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/haskell-ci-hackage.patch
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,26 @@ set in GitHub repository secrets.
jobs:
linux:
name: Haskell-CI - Linux - ${{ matrix.compiler }}
@@ -31,6 +38,7 @@
compilerVersion: 9.0.2
@@ -33,6 +40,7 @@
compilerVersion: 9.8.1
setup-method: ghcup
allow-failure: false
+ upload: true
- compiler: ghc-8.10.7
- compiler: ghc-9.6.3
compilerKind: ghc
compilerVersion: 8.10.7
@@ -237,7 +237,7 @@
${CABAL} -vnormal check
compilerVersion: 9.6.3
@@ -257,6 +265,10 @@
- name: haddock
run: |
- $CABAL v2-haddock --disable-documentation $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
$CABAL v2-haddock --disable-documentation $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
+ - name: haddock for hackage
+ if: matrix.upload
+ run: |
+ $CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH --haddock-for-hackage --builddir $GITHUB_WORKSPACE/haddock all
- name: unconstrained build
run: |
rm -f cabal.project.local
@@ -248,3 +248,75 @@
@@ -267,3 +279,75 @@
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
compilerVersion: 9.8.1
setup-method: ghcup
allow-failure: false
upload: true
- compiler: ghc-9.6.3
compilerKind: ghc
compilerVersion: 9.6.3
Expand All @@ -60,7 +61,6 @@ jobs:
compilerVersion: 9.0.2
setup-method: ghcup
allow-failure: false
upload: true
- compiler: ghc-8.10.7
compilerKind: ghc
compilerVersion: 8.10.7
Expand Down Expand Up @@ -251,6 +251,10 @@ jobs:
cd ${PKGDIR_xmonad_contrib} || false
${CABAL} -vnormal check
- name: haddock
run: |
$CABAL v2-haddock --disable-documentation $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
- name: haddock for hackage
if: matrix.upload
run: |
$CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH --haddock-for-hackage --builddir $GITHUB_WORKSPACE/haddock all
- name: unconstrained build
Expand Down

0 comments on commit 192c0da

Please sign in to comment.