aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test/lib/test_repo/ci.sh
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-06-28 12:56:18 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-06-28 19:12:54 +0200
commitc52e9a6429e9293265ed7912565ee3d1c5fd3217 (patch)
tree97afc850d7e973ddc0916ceb4f76b06ae2117351 /test/lib/test_repo/ci.sh
parenttest/lib: refactoring (diff)
downloadcimple-c52e9a6429e9293265ed7912565ee3d1c5fd3217.tar.gz
cimple-c52e9a6429e9293265ed7912565ee3d1c5fd3217.zip
test: add test for actual CI runs
Diffstat (limited to '')
-rwxr-xr-xtest/lib/test_repo/ci.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/lib/test_repo/ci.sh b/test/lib/test_repo/ci.sh
new file mode 100755
index 0000000..804cdb3
--- /dev/null
+++ b/test/lib/test_repo/ci.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+
+set -o errexit -o nounset -o pipefail
+shopt -s inherit_errexit lastpipe
+
+script_dir="$( dirname -- "${BASH_SOURCE[0]}" )"
+script_dir="$( cd -- "$script_dir" && pwd )"
+readonly script_dir
+
+ci_output_dir="$( git remote get-url origin )"
+ci_output_dir="$ci_output_dir/output"
+readonly ci_output_dir
+
+mkdir -p -- "$ci_output_dir"
+
+readonly ci_output_template=ci_XXXXXX
+
+ci_output_path="$( mktemp --tmpdir="$ci_output_dir" "$ci_output_template" )"
+readonly ci_output_path
+
+timestamp="$( date --iso-8601=ns )"
+readonly timestamp
+
+echo "A CI run happened at $timestamp" | tee -- "$ci_output_path"