Skip to content

Commit 2a3c6ba

Browse files
committed
divide Nix Flake GitHub Action into smaller jobs
* one job for `nix develop` and related * one job for building Hackage binary with `nix build` to avoid GitHub Action resource limit
1 parent d36e81c commit 2a3c6ba

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

.github/workflows/nix-flake.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches:
88
- master
99
jobs:
10-
nix:
10+
nix-develop-shell:
1111
strategy:
1212
fail-fast: false
1313
matrix:
@@ -36,6 +36,29 @@ jobs:
3636
- name: "Check `nix develop` shell can run command"
3737
run: nix develop --command "echo"
3838

39+
nix-build:
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
os:
44+
- ubuntu-latest
45+
- ubuntu-24.04-arm
46+
- macos-latest
47+
name: Nix on ${{ matrix.os }}
48+
runs-on: ${{ matrix.os }}
49+
steps:
50+
- uses: actions/checkout@v4
51+
- uses: cachix/install-nix-action@v31
52+
with:
53+
extra_nix_config: |
54+
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hackage-server.cachix.org-1:iw0iRh6+gsFIrxROFaAt5gKNgIHejKjIfyRdbpPYevY=
55+
substituters = https://cache.nixos.org/ https://hackage-server.cachix.org/
56+
- uses: cachix/cachix-action@v16
57+
with:
58+
# https://nix.dev/tutorials/continuous-integration-github-actions#setting-up-github-actions
59+
name: hackage-server
60+
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
61+
3962
- run: nix build
4063

4164
- continue-on-error: false

0 commit comments

Comments
 (0)