Feature/yksinkertaistetaan raportointi logiikkaa (#22)
unit-tests Bats test report
CI Main / Bats tests (push) Successful in 1m21s
ci-docker-build-push Docker build & push 0.2.9 OK
CI Main / Build & Push Docker (push) Successful in 40s
CI Main / Report Summary (push) Successful in 5s
CI Main / Move provider version tag (push) Successful in 12s
CI Main / Load example-gitea-env.conf to pipeline env (push) Successful in 18s
CI Main / Check existing artifact (push) Successful in 12s
acc-tests Cucumber test report
CI Main / Cucumber tests (push) Successful in 2m3s
unit-tests Bats test report
CI Main / Bats tests (push) Successful in 1m21s
ci-docker-build-push Docker build & push 0.2.9 OK
CI Main / Build & Push Docker (push) Successful in 40s
CI Main / Report Summary (push) Successful in 5s
CI Main / Move provider version tag (push) Successful in 12s
CI Main / Load example-gitea-env.conf to pipeline env (push) Successful in 18s
CI Main / Check existing artifact (push) Successful in 12s
acc-tests Cucumber test report
CI Main / Cucumber tests (push) Successful in 2m3s
Co-authored-by: moilanik <niko.moilanen@tietoevry.com> Reviewed-on: #22
This commit was merged in pull request #22.
This commit is contained in:
@@ -33,7 +33,42 @@ else
|
||||
fi
|
||||
mkdir -p "$TARGET"
|
||||
cp -a "$REPORT_DIR/." "$TARGET/"
|
||||
cat > "$WORK/${OWNER}/${REPO}/reports/${SHA8}/.meta" <<EOF
|
||||
if [ ! -f "$TARGET/index.html" ]; then
|
||||
items=()
|
||||
while IFS= read -r -d '' f; do
|
||||
items+=("$(basename "$f")")
|
||||
done < <(find "$TARGET" -maxdepth 1 -type f ! -name index.html -print0 2>/dev/null || true)
|
||||
while IFS= read -r -d '' d; do
|
||||
name=$(basename "$d")
|
||||
[ -f "$d/index.html" ] && items+=("$name")
|
||||
done < <(find "$TARGET" -maxdepth 1 -type d ! -name . -print0 2>/dev/null || true)
|
||||
|
||||
if [ ${#items[@]} -gt 1 ]; then
|
||||
{
|
||||
echo '<!DOCTYPE html><html lang="en"><head><meta charset="utf-8">'
|
||||
echo "<title>Test report ${SHA8}</title>"
|
||||
echo '<style>body{font-family:sans-serif;margin:2em;max-width:960px}'
|
||||
echo 'h1{color:#1e293b}ul{list-style:none;padding:0}'
|
||||
echo 'li{margin:.5em 0;padding:.5em;background:#f8fafc;border-radius:6px}'
|
||||
echo 'a{color:#2563eb;text-decoration:none}a:hover{text-decoration:underline}'
|
||||
echo '</style></head><body>'
|
||||
echo "<h1>Test report <code>${SHA8}</code></h1><ul>"
|
||||
for item in "${items[@]}"; do
|
||||
label="${item%.*}"
|
||||
label="${label//-/ }"
|
||||
label="${label//_/ }"
|
||||
if [ -f "$TARGET/$item" ]; then
|
||||
echo "<li><a href=\"$item\">${label^}</a></li>"
|
||||
else
|
||||
echo "<li><a href=\"$item/index.html\">${label^}</a></li>"
|
||||
fi
|
||||
done
|
||||
echo '</ul></body></html>'
|
||||
} > "$TARGET/index.html"
|
||||
fi
|
||||
fi
|
||||
|
||||
cat > "$TARGET/.meta" <<EOF
|
||||
{"branch":"${GITHUB_REF_NAME:-}","sha":"${GITHUB_SHA}","published_at":"$(date -u +%Y-%m-%dT%H:%M:%SZ)"}
|
||||
EOF
|
||||
find "$WORK/$OWNER" \( -type f -o -type l \) -print | sed "s|^${WORK}/||" | tar -cf "$TAR" -C "$WORK" -T -
|
||||
|
||||
Reference in New Issue
Block a user