coverage report
CI / load-config (push) Successful in 13s
ci-bats Bats tests FAILED
ci-cucumber Cucumber tests passed
CI / feature (push) Failing after 1m24s
CI / main (push) Has been skipped

This commit is contained in:
moilanik
2026-06-13 18:30:27 +03:00
parent d1ed41036b
commit 1770c3b1c3
3 changed files with 35 additions and 6 deletions
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -euo pipefail
COVERAGE_VOLUME="${1:-}"
REPORT_DIR="${2:-}"
[ -n "$COVERAGE_VOLUME" ] || { echo "ERROR: coverage volume name required" >&2; exit 1; }
[ -n "$REPORT_DIR" ] || { echo "ERROR: report directory required" >&2; exit 1; }
mkdir -p "$REPORT_DIR/coverage"
docker run --rm -v "$COVERAGE_VOLUME":/coverage alpine tar c -C /coverage . | tar x -C "$REPORT_DIR/coverage"
cat > "$REPORT_DIR/index.html" << EOF
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8">
<title>Bats report ${GITHUB_SHA:0:8}</title>
<style>body{font-family:sans-serif;margin:2em;max-width:960px}
h1{color:#1e293b}a{color:#2563eb;text-decoration:none}a:hover{text-decoration:underline}
</style></head><body>
<h1>Bats report <code>${GITHUB_SHA:0:8}</code></h1>
<ul>
<li><a href="test-report.html">Test results</a></li>
<li><a href="coverage/index.html">Coverage report</a></li>
</ul>
</body></html>
EOF
+1 -1
View File
@@ -3,7 +3,7 @@ set -euo pipefail
REPORT_DIR="${1:-reports/bats}"
INPUT="$REPORT_DIR/results.txt"
OUTPUT="$REPORT_DIR/index.html"
OUTPUT="$REPORT_DIR/test-report.html"
[ -f "$INPUT" ] || { echo "ERROR: $INPUT not found" >&2; exit 1; }