-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (51 loc) · 1.92 KB
/
many--nix-flake-check.yaml
File metadata and controls
55 lines (51 loc) · 1.92 KB
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
name: Nix Flake Checks
# Runs `nix flake check` in matrix form on any push or pull request to the main
# branches. This is also the workflow that we will put on the readme. Since you
# shouldn't merge any PR that fails a workflow, this workflow should never fail
# on the main branches. Meaning you'll always have a pretty "CI: passing" badge
# on your README showing the quality of your work.
on:
push:
branches: [main, master, release, development]
pull_request:
branches: [main, master, release, development]
types: [opened, synchronize, reopened]
jobs:
build-nix-flake-check-matrix:
name: Build the Nix flake Matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout repository
uses: actions/checkout@v4.3.0
- name: Install Nix
uses: cachix/install-nix-action@v31.7.0
- name: Generate Nix Matrix
id: set-matrix
run: |
set -Eeu
matrix="$(nix eval --json '.#githubActions.matrix')"
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
nix-flake-check:
name: ${{ matrix.name }} for ${{ matrix.system }}
timeout-minutes: 10
needs: build-nix-flake-check-matrix
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix: ${{fromJSON(needs.build-nix-flake-check-matrix.outputs.matrix)}}
steps:
- name: Checkout repository
uses: actions/checkout@v4.3.0
- name: Install Nix
uses: cachix/install-nix-action@v31.7.0
- name: Add nix cache
uses: nix-community/cache-nix-action@v6.1.3
with:
primary-key: nix-${{ matrix.os }}-${{ hashFiles('**/*.nix') }}
restore-prefixes-first-match: nix-${{ matrix.os }}-
gc-max-store-size-linux: 1073741824
purge: false
- name: Build derivation ${{ matrix.attr }} using Nix
run: nix build --print-build-logs '.#${{ matrix.attr }}'