Update publish-report to simplify inputs, improve Markdown generation, and adjust token usage for Gitea compatibility
Build and Analyse / build-and-analyse (push) Successful in 39s
Build and Analyse / build-and-analyse (push) Successful in 39s
This commit is contained in:
@@ -1,13 +1,9 @@
|
|||||||
name: Publish JUnit Report (Short Names)
|
name: Publish JUnit Report (Short Names)
|
||||||
description: Normalize JUnit XML report names and publish a summary-only test report.
|
description: Normalize JUnit XML report names and publish a test report to the repo.
|
||||||
inputs:
|
inputs:
|
||||||
token:
|
token:
|
||||||
description: GitHub token for creating the check run.
|
description: Gitea token with write access to the repository.
|
||||||
required: true
|
required: true
|
||||||
report-name:
|
|
||||||
description: Name shown for the test report.
|
|
||||||
required: false
|
|
||||||
default: Summary of JUnit Tests
|
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
@@ -27,6 +23,7 @@ runs:
|
|||||||
- name: Generate Markdown Report
|
- name: Generate Markdown Report
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
mkdir -p reports
|
||||||
python3 - <<'EOF'
|
python3 - <<'EOF'
|
||||||
import glob, xml.etree.ElementTree as ET
|
import glob, xml.etree.ElementTree as ET
|
||||||
|
|
||||||
@@ -55,19 +52,16 @@ runs:
|
|||||||
total_passed = total_tests - total_failures - total_errors - total_skipped
|
total_passed = total_tests - total_failures - total_errors - total_skipped
|
||||||
overall = "✅ All tests passed" if (total_failures + total_errors) == 0 else "❌ Some tests failed"
|
overall = "✅ All tests passed" if (total_failures + total_errors) == 0 else "❌ Some tests failed"
|
||||||
|
|
||||||
md = f"""# Test Report
|
md = (
|
||||||
|
"# Test Report\n\n"
|
||||||
**{overall}**
|
f"**{overall}**\n\n"
|
||||||
|
"| | Tests | Passed | Failed | Skipped |\n"
|
||||||
| | Tests | Passed | Failed | Skipped |
|
"|---|---|---|---|---|\n"
|
||||||
|---|---|---|---|---|
|
f"| **Total** | {total_tests} | {total_passed} | {total_failures + total_errors} | {total_skipped} |\n\n"
|
||||||
| **Total** | {total_tests} | {total_passed} | {total_failures + total_errors} | {total_skipped} |
|
"## Details\n\n"
|
||||||
|
"| Status | Suite | Tests | Passed | Failed | Skipped |\n"
|
||||||
## Details
|
"|---|---|---|---|---|---|\n"
|
||||||
|
) + "\n".join(rows) + "\n"
|
||||||
| Status | Suite | Tests | Passed | Failed | Skipped |
|
|
||||||
|---|---|---|---|---|---|
|
|
||||||
""" + "\n".join(rows) + "\n"
|
|
||||||
|
|
||||||
with open("reports/index.md", "w") as out:
|
with open("reports/index.md", "w") as out:
|
||||||
out.write(md)
|
out.write(md)
|
||||||
|
|||||||
Reference in New Issue
Block a user