aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/check.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xscripts/check.sh54
1 files changed, 36 insertions, 18 deletions
diff --git a/scripts/check.sh b/scripts/check.sh
index f152cbb..dbfa67d 100755
--- a/scripts/check.sh
+++ b/scripts/check.sh
@@ -1,20 +1,38 @@
#! /usr/bin/env sh
-# --log-format multiline-with-logs \
-nix build \
- --option max-jobs 1 \
- --print-out-paths --no-link \
- .#checks.x86_64-linux.atuin-sync \
- .#checks.x86_64-linux.back \
- .#checks.x86_64-linux.deploy-activate \
- .#checks.x86_64-linux.deploy-schema \
- .#checks.x86_64-linux.dns \
- .#checks.x86_64-linux.formatting \
- .#checks.x86_64-linux.git-server \
- .#checks.x86_64-linux.rust-motd \
- .#checks.x86_64-linux.sharkey \
- .#checks.x86_64-linux.sharkey-cpu \
- .#checks.x86_64-linux.taskchampion-sync
-# .#checks.x86_64-linux.email-dns \
-# .#checks.x86_64-linux.email-http \
-# .#checks.x86_64-linux.email-ip \
+git_root="$(git rev-parse --show-toplevel)"
+
+fmt_check() {
+ echo ".#checks.x86_64-linux.$1"
+}
+
+failed="$(mktemp -t server_check_XXXXX)"
+trap 'rm -f "$failed"' EXIT
+trap 'exit 4' HUP INT QUIT TERM
+
+# We want word-splitting for the arg
+# shellcheck disable=SC2046
+set -- $(nix eval --file "$git_root/scripts/check_get_tests.nix" --raw)
+
+while [ "$#" -ne 0 ]; do
+ test="$1"
+ shift 1
+
+ echo "Building test '$test'..."
+ fmt_test="$(fmt_check "$test")"
+
+ if ! nix build \
+ --option max-jobs 1 \
+ --print-out-paths \
+ --no-link \
+ "$fmt_test"; then
+ echo "$test" >>"$failed"
+ fi
+done
+
+if [ "$(cat "$failed" | wc -l)" -ne 0 ]; then
+ echo "Failed tests:"
+ while read -r test; do
+ echo " - $test"
+ done <"$failed"
+fi