ci: publish actual Endor example outputs as artifacts
Verify databases and deploy Aster VM / verify-and-deploy (push) Successful in 7m49s
Verify databases and deploy Aster VM / verify-and-deploy (push) Successful in 7m49s
This commit is contained in:
@@ -12,6 +12,12 @@ network="endorphin-aster-vm-ci-$ci_id"
|
||||
postgres="endorphin-aster-vm-ci-pg-$ci_id"
|
||||
checks="endorphin-aster-vm-ci-checks-$ci_id"
|
||||
image="endorphin-aster-vm-ci:$release_sha"
|
||||
report_dir="$PWD/ci-output"
|
||||
mkdir -p "$report_dir"
|
||||
# Reset both outputs before any build, so even an early failure has an honest
|
||||
# NOT_RUN artifact rather than a previous attempt's example results.
|
||||
printf '# Endor 示例实际运行结果\n\n提交:%s\n\n状态:NOT_RUN\n\nCI 尚未完成示例执行;请查看验证步骤日志。\n' "$release_sha" > "$report_dir/endor-examples.md"
|
||||
printf '{"format_version":1,"commit":"%s","status":"NOT_RUN","error":"CI did not finish example execution; inspect the verification log.","cases":[]}\n' "$release_sha" > "$report_dir/endor-examples.json"
|
||||
cleanup() {
|
||||
docker rm -f "$checks" "$postgres" >/dev/null 2>&1 || true
|
||||
docker network rm "$network" >/dev/null 2>&1 || true
|
||||
@@ -41,12 +47,29 @@ if [ "$ready" != true ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
check_status=0
|
||||
docker run --name "$checks" --init --network "$network" \
|
||||
--mount type=volume,src=endorphin-aster-vm-ci-cargo,dst=/usr/local/cargo/registry \
|
||||
--mount type=volume,src=endorphin-aster-vm-ci-target,dst=/build/target \
|
||||
--env ASTER_TEST_POSTGRES_URL='postgres://aster:aster-ci-only@postgres:5432/aster?sslmode=disable' \
|
||||
--env ASTER_RELEASE_SHA="$release_sha" \
|
||||
"$image" sh -eu -c '
|
||||
sh scripts/check.sh
|
||||
checks=0
|
||||
sh scripts/check.sh || checks=$?
|
||||
examples=0
|
||||
python3 scripts/endor_examples.py --output-dir /build/ci-output || examples=$?
|
||||
test "$checks" -eq 0
|
||||
test "$examples" -eq 0
|
||||
cargo test -p storage --test postgres --locked -- --ignored
|
||||
python3 scripts/smoke.py
|
||||
'
|
||||
' || check_status=$?
|
||||
|
||||
# Copy reports before the EXIT trap removes the stopped checks container.
|
||||
# Keep the original validation failure status if report extraction also fails.
|
||||
copy_status=0
|
||||
docker cp "$checks:/build/ci-output/endor-examples.md" "$report_dir/endor-examples.md" || copy_status=$?
|
||||
docker cp "$checks:/build/ci-output/endor-examples.json" "$report_dir/endor-examples.json" || copy_status=$?
|
||||
if [ "$check_status" -ne 0 ]; then
|
||||
exit "$check_status"
|
||||
fi
|
||||
exit "$copy_status"
|
||||
|
||||
Reference in New Issue
Block a user