diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-07-07 12:38:42 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-07-07 12:38:42 +0200 |
| commit | a4bc7e0b10f6cd3b93547f1dd20707e20aac4f7b (patch) | |
| tree | 83d4378de997c461594384f958604289cffe70ad | |
| parent | flake.lock: Update (diff) | |
| download | nixos-server-a4bc7e0b10f6cd3b93547f1dd20707e20aac4f7b.zip | |
scripts/check.sh: Compute the list of checks instead of hard-coding it
| -rwxr-xr-x | scripts/check.sh | 38 | ||||
| -rw-r--r-- | scripts/check_get_tests.nix | 16 |
2 files changed, 25 insertions, 29 deletions
diff --git a/scripts/check.sh b/scripts/check.sh index 9f40c99..aa21f1e 100755 --- a/scripts/check.sh +++ b/scripts/check.sh @@ -1,38 +1,18 @@ #! /usr/bin/env sh +git_root="$(git rev-parse --show-toplevel)" + fmt_check() { echo ".#checks.x86_64-linux.$1" } -check() { - tests="$(fmt_check "$1")" - shift 1 - - for test in "$@"; do - tests="$tests $(fmt_check "$test")" - done - - set -x - # We want to expand `$tests`. - # shellcheck disable=SC2086 +nix eval \ + --file "$git_root/scripts/check_get_tests.nix" \ + --raw | while read -r test; do + echo "Building test '$test'..." + test="$(fmt_check "$test")" nix build \ --option max-jobs 1 \ --print-out-paths --no-link \ - $tests -} - -check atuin-sync \ - back \ - deploy-activate \ - deploy-schema \ - dns \ - formatting \ - git-server \ - rocie \ - rust-motd \ - sharkey \ - sharkey-cpu \ - taskchampion-sync -# email-dns \ -# email-http \ -# email-ip \ + "$test" +done diff --git a/scripts/check_get_tests.nix b/scripts/check_get_tests.nix new file mode 100644 index 0000000..a39d300 --- /dev/null +++ b/scripts/check_get_tests.nix @@ -0,0 +1,16 @@ +let + get = input: (builtins.fetchTree input.locked).outPath; + + lock = (builtins.fromJSON (builtins.readFile ../flake.lock)).nodes; + + flake-compat = import (get lock.flake-compat) {src = ../.;}; + pkgs = import (get lock.nixpkgs) {}; + inherit (pkgs) lib; + + inherit (flake-compat) outputs; +in + lib.strings.concatStringsSep "\n" + (builtins.attrNames + (lib.filterAttrs + (name: test: test.meta.broken == false) + outputs.checks.x86_64-linux)) |
