-
Notifications
You must be signed in to change notification settings - Fork 6
42 lines (41 loc) · 1.11 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
name: "CI"
on:
push:
branches:
- "**"
- "!main"
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
outputs:
configs: ${{ steps.list-configs.outputs.configs }}
steps:
- uses: actions/checkout@v3
- uses: determinatesystems/nix-installer-action@v4
- name: nix flake check
run: |
nix flake check
- name: List NixOS configurations
id: list-configs
run:
echo "configs=$(nix flake show --json | jq -c '.nixosConfigurations | keys')" > $GITHUB_OUTPUT
build:
runs-on: ubuntu-latest
needs:
- check
strategy:
fail-fast: false
matrix:
system: ${{ fromJSON(needs.check.outputs.configs) }}
steps:
- uses: actions/checkout@v3
- uses: determinatesystems/nix-installer-action@v4
- uses: determinatesystems/magic-nix-cache-action@v2
- env:
NIXOS_CONFIG: ${{ matrix.system }}
run: |
nix build ".#nixosConfigurations.$NIXOS_CONFIG.config.system.build.toplevel"