-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (62 loc) · 1.92 KB
/
nix-github-actions.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Nix Flake actions
on:
pull_request:
push:
branches:
- master
- main
jobs:
nix-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
- id: set-matrix
name: Generate Nix Matrix
run: |
set -euo pipefail
matrix="$(nix eval --json '.#githubActions.matrix')"
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
echo "$matrix" | jq
nix-build:
needs: nix-matrix
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # let it build all the targets
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
steps:
- name: Free diskspace
uses: easimon/maximize-build-space@master
with:
build-mount-path: /nix
root-reserve-mb: 5120
remove-dotnet: true
remove-android: true
remove-haskell: true
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
with:
extra_nix_config: |
auto-optimise-store = true
system-features = nixos-test benchmark big-parallel kvm
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
experimental-features = nix-command flakes
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: cachix/cachix-action@v14
with:
name: snowflake
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- uses: nixbuild/nixbuild-action@v19
with:
nixbuild_token: ${{ secrets.NIXBUILD_AUTH_TOKEN }}
generate_summary_for: 'workflow'
- run: |
nix build \
--print-build-logs \
--builders "" \
--max-jobs 2 \
--eval-store auto \
--store ssh-ng://eu.nixbuild.net \
".#githubActions.checks.${{ matrix.attr }}"