Skip to content

Commit 352d700

Browse files
committed
Use GHC 9.14 for haddocks
1 parent 8da9a7e commit 352d700

5 files changed

Lines changed: 87 additions & 61 deletions

File tree

.github/workflows/github-page.yml

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: "Haddock documentation"
22

33
on:
4+
workflow_dispatch:
5+
pull_request: # TODO: remove
46
push:
57
branches:
68
- master
@@ -14,48 +16,52 @@ jobs:
1416
shell: bash
1517

1618
steps:
17-
- name: Install Nix
18-
uses: cachix/install-nix-action@v18
19+
- uses: actions/checkout@v6
20+
21+
- uses: cachix/install-nix-action@v31
1922
with:
20-
# Use last stable nixos channel and the same nix as in channel:
21-
nix_path: nixpkgs=channel:nixos-24.05
2223
github_access_token: ${{ secrets.GITHUB_TOKEN }}
2324
extra_nix_config: |
25+
accept-flake-config = true
2426
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
25-
experimental-features = nix-command flakes
26-
allow-import-from-derivation = true
27-
substituters = https://cache.nixos.org https://cache.iog.io
28-
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
2927
30-
- uses: actions/checkout@v4
28+
# GHC 9.14 avoids the tyConStupidTheta panic in GHC 9.6 haddock
29+
- uses: rrbutani/use-nix-shell-action@v1
30+
with:
31+
devShell: .#ghc914
3132

32-
- name: Fetch nix cache and update cabal indices
33+
- name: Update cabal indices
3334
run: |
34-
nix develop --command \
35-
cabal update
35+
cabal update
3636
3737
- name: Build whole project
3838
run: |
39-
nix develop --command \
40-
cabal build all
39+
cabal build all
4140
4241
- name: Build documentation
4342
run: |
44-
nix develop --command \
45-
cabal haddock-project --local --output=./haddocks --internal --foreign-libraries
43+
cabal haddock-project --local --output=./haddocks --internal --foreign-libraries
4644
4745
- name: Compress haddocks
4846
run: |
4947
tar -czf haddocks.tgz -C haddocks .
5048
5149
- name: Upload haddocks artifact
52-
uses: actions/upload-artifact@v4
50+
uses: actions/upload-artifact@v7
5351
if: ${{ always() }}
5452
continue-on-error: true
5553
with:
5654
name: haddocks
5755
path: ./haddocks.tgz
5856

57+
- name: Upload cabal logs
58+
uses: actions/upload-artifact@v7
59+
if: failure()
60+
continue-on-error: true
61+
with:
62+
name: cabal-haddock-logs
63+
path: ~/.cache/cabal/logs/
64+
5965
- name: Deploy documentation to gh-pages 🚀
6066
if: github.ref == 'refs/heads/master'
6167
uses: peaceiris/actions-gh-pages@v4

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,5 @@ cardano-tracer/cardano-tracer-test
7777
.idea/
7878

7979
.codex
80+
81+
.serena

flake.lock

Lines changed: 59 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@
189189
default = shell.dev;
190190
cluster = shell;
191191
profiled = project.profiled.shell;
192+
ghc914 = project.projectVariants.ghc914.shell;
192193
};
193194

194195
# NixOS tests a sandboxed mainnet edge node with submit-api, ensuring

nix/haskell.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ let
2323
src = ../.;
2424
name = "cardano-node";
2525
compiler-nix-name = lib.mkDefault (if pkgs.stdenv.hostPlatform.isWindows then windowsCompilerNixName else "ghc967");
26-
# Extra-compilers
27-
# flake.variants = lib.genAttrs ["ghc$VERSION"] (x: {compiler-nix-name = x;});
26+
# Used for haddock generation (avoids GHC 9.6 tyConStupidTheta panic)
27+
flake.variants = lib.genAttrs ["ghc914"] (x: {compiler-nix-name = x;});
2828
cabalProjectLocal = ''
2929
repository cardano-haskell-packages-local
3030
url: file:${CHaP}

0 commit comments

Comments
 (0)