-
Notifications
You must be signed in to change notification settings - Fork 597
64 lines (51 loc) · 1.69 KB
/
nix-flake-check.yaml
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
name: Check and build
on:
pull_request:
push:
branches:
- master
jobs:
dependencies:
name: Build dependencies
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Set up Git repository
uses: actions/checkout@v3
- name: Create global variables
id: version
run:
echo "version=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
determine-matrix:
name: Figure out the packages we need to build
runs-on: ubuntu-latest
needs: [dependencies]
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Set up Git repository
uses: actions/checkout@v3
- name: Install the Nix package manager
uses: cachix/install-nix-action@v20
- id: set-matrix
run: |
echo "matrix=$(
nix eval --json .#packages.x86_64-linux --apply builtins.attrNames
)" >> $GITHUB_OUTPUT
build:
name: Build
needs: determine-matrix
runs-on: ubuntu-latest
strategy:
matrix:
packages: ${{fromJson(needs.determine-matrix.outputs.matrix)}}
steps:
- name: Set up Git repository
uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v20
- name: Nix flake check
run: nix flake check
- name: Build ${{ matrix.packages }}.pdf
run: nix build .#${{ matrix.packages }}