Skip to content

Commit 3076d6d

Browse files
committed
Add swap for haddocks
1 parent 8da9a7e commit 3076d6d

2 files changed

Lines changed: 24 additions & 18 deletions

File tree

.github/workflows/github-page.yml

Lines changed: 22 additions & 18 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,42 +16,44 @@ 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+
- uses: rrbutani/use-nix-shell-action@v1
29+
30+
# Haddock exhausts the runner's 7GB RAM and gets OOM-killed.
31+
- name: Set up swap
32+
run: |
33+
sudo fallocate -l 10G /swapfile
34+
sudo chmod 600 /swapfile
35+
sudo mkswap /swapfile
36+
sudo swapon /swapfile
37+
free -h
3138
32-
- name: Fetch nix cache and update cabal indices
39+
- name: Update cabal indices
3340
run: |
34-
nix develop --command \
35-
cabal update
41+
cabal update
3642
3743
- name: Build whole project
3844
run: |
39-
nix develop --command \
40-
cabal build all
45+
cabal build all
4146
4247
- name: Build documentation
4348
run: |
44-
nix develop --command \
45-
cabal haddock-project --local --output=./haddocks --internal --foreign-libraries
49+
cabal haddock-project --local --output=./haddocks --internal --foreign-libraries
4650
4751
- name: Compress haddocks
4852
run: |
4953
tar -czf haddocks.tgz -C haddocks .
5054
5155
- name: Upload haddocks artifact
52-
uses: actions/upload-artifact@v4
56+
uses: actions/upload-artifact@v7
5357
if: ${{ always() }}
5458
continue-on-error: true
5559
with:
@@ -58,7 +62,7 @@ jobs:
5862

5963
- name: Deploy documentation to gh-pages 🚀
6064
if: github.ref == 'refs/heads/master'
61-
uses: peaceiris/actions-gh-pages@v4
65+
uses: peaceiris/actions-gh-pages@v6
6266
with:
6367
github_token: ${{ secrets.GITHUB_TOKEN || github.token }}
6468
publish_dir: haddocks

.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

0 commit comments

Comments
 (0)