Skip to content

feat: HTML report artifact generation#32

Merged
maximn merged 15 commits into
mainfrom
feat/visual-report-redesign
Apr 6, 2026
Merged

feat: HTML report artifact generation#32
maximn merged 15 commits into
mainfrom
feat/visual-report-redesign

Conversation

@maximn
Copy link
Copy Markdown
Contributor

@maximn maximn commented Apr 6, 2026

Summary

Generates a self-contained HTML test report and uploads it as a GitHub Actions
artifact after each run. Enabled by default (html-report: true). A direct
link to the artifacts section of the run is surfaced in both the CI job summary
and the PR comment.

Changes

  • action.yml — new html-report (boolean, default true) and artifact-name
    (string, default testglance-report) inputs
  • src/output/html-report.ts — pure generateHtmlReport() returning a
    self-contained HTML string: inline CSS, responsive layout, all sections
    matching the CI summary (header, highlights, trends, delta, tests changed,
    flaky, perf regressions, suite breakdown, failed tests with collapsible stack
    traces, slowest tests), metadata footer with commit SHA / branch / run link
  • src/output/upload-artifact.ts — thin wrapper around DefaultArtifactClient
    that writes the HTML to a temp file, uploads, then cleans up; errors are
    core.warning() only, never core.setFailed()
  • src/output/pr-comment.ts — added optional artifactUrl field; rendered as
    a 📄 HTML Report link next to "View Run"
  • src/output/summary.ts — added optional artifactUrl field; rendered as a
    download link at the bottom of the job summary
  • src/index.ts — HTML report generated before summary so artifactUrl is
    available for both summary and PR comment
  • @actions/artifact pinned to v2.3.2 (v6 is ESM-only, incompatible with ncc)

Test plan

  • Merge and trigger a workflow run — confirm testglance-report appears
    under Artifacts in the run summary
  • Download and open the HTML file — verify all sections render correctly in
    browser, stack traces are collapsible
  • Check the PR comment has a 📄 HTML Report link pointing to #artifacts
  • Confirm html-report: false skips generation with no artifact uploaded
  • Confirm upload failure only logs a warning and does not fail the action

maximn added 15 commits April 5, 2026 22:38
Replace flat metric tables with status-first hero header, Unicode
progress bar, and single-line metrics strip. Consolidate per-test
failure tables into one HTML table with bold test names. Wrap slowest
tests in a collapsible <details> block. Add emoji section headers
throughout. Move API failure warning above metrics. Extract shared
formatting utilities (renderProgressBar, statusEmoji, renderMetricsStrip)
to src/output/format.ts. PR comment omits zero failed count on passing
runs and only shows the stats/details divider when content is present.
Each failure now renders as its own table + stack trace block
instead of all failures in one table followed by all traces.
Replace per-failure HTML tables with a compact block layout:
test name in inline code + suite + blockquote error message.
Stack trace stays directly below its failure.
Generates a self-contained HTML report and uploads it as a GitHub Actions
artifact after each run. Enabled by default (html-report: true).

- New html-report and artifact-name inputs in action.yml
- src/output/html-report.ts: pure generateHtmlReport() with inline CSS,
  all summary sections, collapsible stack traces, metadata footer
- src/output/upload-artifact.ts: DefaultArtifactClient wrapper with
  non-blocking error handling and temp file cleanup
- Artifact URL (run#artifacts) surfaced in CI summary and PR comment
- 50 new tests; all 632 pass
v6 is ESM-only and incompatible with ncc bundling.
v2.x has a commonjs main entry that ncc can bundle correctly.
Adds a Permissions section explaining which features need which
permissions, with a job-level example and a note about the
non-blocking guarantee when permissions are missing.

Also updates the Quick Start "With PR Comments" snippet to include
the required permissions block inline.
Unique filename prevents collisions when multiple jobs run in the
same temp directory. Boolean return lets the caller skip setting
artifactUrl when the upload actually failed.
Resolve conflict in src/output/summary.ts (visual redesign vs
artifact-url addition) and rebuild dist.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 6, 2026

@maximn maximn merged commit 4ee699d into main Apr 6, 2026
6 checks passed
@maximn maximn deleted the feat/visual-report-redesign branch April 6, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant