-
-
Notifications
You must be signed in to change notification settings - Fork 109
48 lines (45 loc) · 1.3 KB
/
ci.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
name: "Continuous Integration"
on:
workflow_dispatch: # allows manual triggering
push:
jobs:
eval:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.eval-jobs.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
- name: Evaluate hydraJobs
id: eval-jobs
run: |
MATRIX=$(nix eval \
--accept-flake-config \
--json \
.#hydraJobs.x86_64-linux --apply builtins.attrNames \
)
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
build:
name: ${{ matrix.check }}
needs: eval
strategy:
fail-fast: false
matrix:
check: ${{ fromJson(needs.eval.outputs.matrix) }}
runs-on: ubuntu-latest
env:
NIX_ATTR: 'hydraJobs.x86_64-linux.${{ matrix.check }}'
steps:
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
- name: Build ${{ matrix.check }}
run: |
nix build \
-vL \
--accept-flake-config \
".#$NIX_ATTR"