-
Notifications
You must be signed in to change notification settings - Fork 62
39 lines (38 loc) · 1.23 KB
/
check.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
# SPDX-FileCopyrightText: 2022-2023 TII (SSRC) and the Ghaf contributors
#
# SPDX-License-Identifier: Apache-2.0
name: check
on:
pull_request:
branches:
- main
jobs:
run-checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install nix
uses: cachix/install-nix-action@v30
- name: Check .nix formatting
run: nix fmt -- --fail-on-change
- name: Check reuse lint
run: nix develop --command reuse lint
- name: Check nix flake show runs successfully
run: nix flake show
- name: evaluation check
run: nix develop --command make-checks
- name: Check templates
run: |
set -eux -o pipefail
tmp_flakes=$(mktemp -d)
cleanup() { rm -rf "$tmp_flakes"; }
trap cleanup EXIT
nix eval --json --apply builtins.attrNames .#templates | jq -r '.[]' | while IFS=$'\t' read -r name; do
nix flake new -t ".#$name" "${tmp_flakes}/${name}";
if [[ "$name" == "ghaf-module" ]]; then
nix-instantiate --parse "${tmp_flakes}/${name}/default.nix"
else
nix flake show "${tmp_flakes}/${name}"
fi
done