coverage report
This commit is contained in:
Executable
+25
@@ -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
|
||||
Reference in New Issue
Block a user