summaryrefslogtreecommitdiff
path: root/Biz
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2024-04-03 15:29:37 -0400
committerBen Sima <ben@bsima.me>2024-04-03 16:18:12 -0400
commit177b2f42de0339c3ac91ee7b9a91d47bd39d3062 (patch)
tree6ba553d2cb57e034e0a975b0911ae940bcd00327 /Biz
parent432739b3e950f3ee33d4f083343b28f7755d0861 (diff)
Don't exit CI script on failure
The whole point is to catch errors and write the result to the git notes, if the process exits then we can't do that.
Diffstat (limited to 'Biz')
-rwxr-xr-xBiz/Ci.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/Biz/Ci.sh b/Biz/Ci.sh
index 9dbfd5b..c6b1f7a 100755
--- a/Biz/Ci.sh
+++ b/Biz/Ci.sh
@@ -9,8 +9,10 @@
# It would be cool to use a zero-knowledge proof mechanism here to prove that
# so-and-so ran the tests, but I'll have to research how to do that.
#
+# ensure we don't exit on bild failure, only on CI script error
+ set +e
+ set -u
##
- set -uo pipefail
[[ -n $(git status -s) ]] && { echo fail: dirty worktree; exit 1; }
##
at=$(date -R)
@@ -37,7 +39,6 @@
lint_result="good"
else
lint_result="fail"
- exit 1
fi
##
if bild "${BILD_ARGS:-""}" --test "${CODEROOT:?}"/**/*
@@ -45,7 +46,6 @@
test_result="good"
else
test_result="fail"
- exit 1
fi
##
read -r -d '' note <<EOF
@@ -57,3 +57,6 @@ EOF
##
git notes --ref=ci append -m "$note"
##
+# exit 1 if failure
+ [[ ! "$lint_result" == "fail" && ! "$test_result" == "fail" ]]
+##