From 0658031afbb8d31cf4a911a2e8b8f890b808d069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 11 Apr 2024 16:54:30 +0200 Subject: [PATCH] add regression test for all templates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörg Thalheim --- .github/workflows/check.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 5ffcc6fb7..6f513208e 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -23,3 +23,18 @@ jobs: run: nix develop --command reuse lint - name: Check nix flake show runs successfully run: nix flake show + - 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 +