11name : " Haddock documentation"
22
33on :
4+ workflow_dispatch :
5+ pull_request : # TODO: remove
46 push :
57 branches :
68 - master
@@ -14,42 +16,45 @@ 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+ # Haddock exhausts the runner's RAM and gets OOM-killed.
22+ - name : Set up swap
23+ run : |
24+ sudo fallocate -l 10G /swapfile2
25+ sudo chmod 600 /swapfile2
26+ sudo mkswap /swapfile2
27+ sudo swapon /swapfile2
28+ free -h
29+ df -h /
30+
31+ - uses : cachix/install-nix-action@v31
1932 with :
20- # Use last stable nixos channel and the same nix as in channel:
21- nix_path : nixpkgs=channel:nixos-24.05
2233 github_access_token : ${{ secrets.GITHUB_TOKEN }}
2334 extra_nix_config : |
35+ accept-flake-config = true
2436 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=
2937
30- - uses : actions/checkout@v4
38+ - uses : rrbutani/use-nix-shell-action@v1
3139
32- - name : Fetch nix cache and update cabal indices
40+ - name : Update cabal indices
3341 run : |
34- nix develop --command \
35- cabal update
42+ cabal update
3643
3744 - name : Build whole project
3845 run : |
39- nix develop --command \
40- cabal build all
46+ cabal build all
4147
4248 - name : Build documentation
4349 run : |
44- nix develop --command \
45- cabal haddock-project --local --output=./haddocks --internal --foreign-libraries
50+ cabal haddock-project --local --output=./haddocks --internal --foreign-libraries
4651
4752 - name : Compress haddocks
4853 run : |
4954 tar -czf haddocks.tgz -C haddocks .
5055
5156 - name : Upload haddocks artifact
52- uses : actions/upload-artifact@v4
57+ uses : actions/upload-artifact@v7
5358 if : ${{ always() }}
5459 continue-on-error : true
5560 with :
0 commit comments