aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/check.sh38
-rw-r--r--scripts/check_get_tests.nix16
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))