11name : " Haddock documentation"
22
33on :
4+ workflow_dispatch :
5+ pull_request : # TODO: remove
46 push :
57 branches :
68 - master
@@ -14,42 +16,46 @@ 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 7GB RAM and gets OOM-killed.
22+ # Put swap on /mnt (separate volume) to avoid filling the / partition where the build lives.
23+ - name : Set up swap
24+ run : |
25+ sudo fallocate -l 10G /mnt/swapfile
26+ sudo chmod 600 /mnt/swapfile
27+ sudo mkswap /mnt/swapfile
28+ sudo swapon /mnt/swapfile
29+ free -h
30+ df -h /
31+
32+ - uses : cachix/install-nix-action@v31
1933 with :
20- # Use last stable nixos channel and the same nix as in channel:
21- nix_path : nixpkgs=channel:nixos-24.05
2234 github_access_token : ${{ secrets.GITHUB_TOKEN }}
2335 extra_nix_config : |
36+ accept-flake-config = true
2437 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=
2938
30- - uses : actions/checkout@v4
39+ - uses : rrbutani/use-nix-shell-action@v1
3140
32- - name : Fetch nix cache and update cabal indices
41+ - name : Update cabal indices
3342 run : |
34- nix develop --command \
35- cabal update
43+ cabal update
3644
3745 - name : Build whole project
3846 run : |
39- nix develop --command \
40- cabal build all
47+ cabal build all
4148
4249 - name : Build documentation
4350 run : |
44- nix develop --command \
45- cabal haddock-project --local --output=./haddocks --internal --foreign-libraries
51+ cabal haddock-project --local --output=./haddocks --internal --foreign-libraries
4652
4753 - name : Compress haddocks
4854 run : |
4955 tar -czf haddocks.tgz -C haddocks .
5056
5157 - name : Upload haddocks artifact
52- uses : actions/upload-artifact@v4
58+ uses : actions/upload-artifact@v7
5359 if : ${{ always() }}
5460 continue-on-error : true
5561 with :
0 commit comments