ci: Only build haddock for hackage with the latest GHC

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: https://github.com/haskell/haddock/issues/1582#issuecomment-1611412223
Related: https://github.com/haskell/cabal/issues/8326
Related: https://github.com/haskell/cabal/issues/9060
Related: https://github.com/haskell/cabal/pull/9073
Related: https://github.com/haskell/cabal/pull/9049
This commit is contained in:
Tomas Janousek 2023-11-12 23:34:53 +00:00
parent e38e19edc1
commit 192c0da831
2 changed files with 15 additions and 9 deletions

View File

@ -37,24 +37,26 @@ set in GitHub repository secrets.
jobs: jobs:
linux: linux:
name: Haskell-CI - Linux - ${{ matrix.compiler }} name: Haskell-CI - Linux - ${{ matrix.compiler }}
@@ -31,6 +38,7 @@ @@ -33,6 +40,7 @@
compilerVersion: 9.0.2 compilerVersion: 9.8.1
setup-method: ghcup setup-method: ghcup
allow-failure: false allow-failure: false
+ upload: true + upload: true
- compiler: ghc-8.10.7 - compiler: ghc-9.6.3
compilerKind: ghc compilerKind: ghc
compilerVersion: 8.10.7 compilerVersion: 9.6.3
@@ -237,7 +237,7 @@ @@ -257,6 +265,10 @@
${CABAL} -vnormal check
- name: haddock - name: haddock
run: | 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 + $CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH --haddock-for-hackage --builddir $GITHUB_WORKSPACE/haddock all
- name: unconstrained build - name: unconstrained build
run: | run: |
rm -f cabal.project.local rm -f cabal.project.local
@@ -248,3 +248,75 @@ @@ -267,3 +279,75 @@
with: with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store path: ~/.cabal/store

View File

@ -40,6 +40,7 @@ jobs:
compilerVersion: 9.8.1 compilerVersion: 9.8.1
setup-method: ghcup setup-method: ghcup
allow-failure: false allow-failure: false
upload: true
- compiler: ghc-9.6.3 - compiler: ghc-9.6.3
compilerKind: ghc compilerKind: ghc
compilerVersion: 9.6.3 compilerVersion: 9.6.3
@ -60,7 +61,6 @@ jobs:
compilerVersion: 9.0.2 compilerVersion: 9.0.2
setup-method: ghcup setup-method: ghcup
allow-failure: false allow-failure: false
upload: true
- compiler: ghc-8.10.7 - compiler: ghc-8.10.7
compilerKind: ghc compilerKind: ghc
compilerVersion: 8.10.7 compilerVersion: 8.10.7
@ -251,6 +251,10 @@ jobs:
cd ${PKGDIR_xmonad_contrib} || false cd ${PKGDIR_xmonad_contrib} || false
${CABAL} -vnormal check ${CABAL} -vnormal check
- name: haddock - 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: | run: |
$CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH --haddock-for-hackage --builddir $GITHUB_WORKSPACE/haddock all $CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH --haddock-for-hackage --builddir $GITHUB_WORKSPACE/haddock all
- name: unconstrained build - name: unconstrained build