Copy real test inputs into nested CI containers
pr / test (pull_request) Successful in 57s

This commit is contained in:
2026-09-19 16:20:59 +02:00
parent 904f3fffe6
commit c0843af83e
3 changed files with 12 additions and 10 deletions
+8 -3
View File
@@ -3,7 +3,7 @@
set -euo pipefail
name="btcdata-test-${GITHUB_RUN_ID:-$$}-${GITHUB_RUN_ATTEMPT:-1}"
cleanup() {
docker rm -f "$name" >/dev/null 2>&1 || true
docker rm -f "${name}-runner" "$name" >/dev/null 2>&1 || true
docker network rm "$name" >/dev/null 2>&1 || true
}
trap cleanup EXIT
@@ -22,6 +22,11 @@ if [ "$ready" != true ]; then
echo 'Disposable PostgreSQL did not become ready' >&2
exit 1
fi
docker run --rm --network "$name" -v "$PWD:/app" -w /app \
# The CI workspace is inside the runner container, not on the Docker host.
# Copy only test inputs; never mount a nonexistent host workspace or copy .env/.git.
docker create --name "${name}-runner" --network "$name" -w /app \
-e "BTCDATA_TEST_JDBC_URL=jdbc:postgresql://$name:5432/postgres?user=postgres" \
clojure:temurin-21-tools-deps-alpine clj -M:test
clojure:temurin-21-tools-deps-alpine clj -M:test >/dev/null
COPYFILE_DISABLE=1 tar --no-xattrs -cf - deps.edn src resources test env/test | docker cp - "${name}-runner:/app"
docker start --attach "${name}-runner"
exit "$(docker inspect --format '{{.State.ExitCode}}' "${name}-runner")"