Commit 05243c6
ci: publish detailed coverage reports for backend + frontend
Adds first-class coverage reporting to the CI workflow. Previously only a raw coverage.out was uploaded for backend; frontend coverage was configured locally but never wired into CI.
Backend (.github/workflows/ci.yml backend job):
- Test step now uses -covermode=atomic (race-safe and required for accurate concurrent coverage)
- New 'Generate backend coverage reports' step runs after the test step (if: always() so it still publishes when a downstream step like Build fails) and produces:
- coverage.txt (per-function, from 'go tool cover -func')
- coverage.html (browsable annotated source, from 'go tool cover -html')
- coverage-by-package.txt (statement coverage averaged per package, sorted high-to-low) via an awk roll-up
- GITHUB_STEP_SUMMARY now shows the total-statements percent and a collapsible top-50 per-package table directly in the Actions run UI
- Upload-artifact step renamed coverage → backend-coverage and now includes all four files
Frontend (.github/workflows/ci.yml frontend job + web/vite.config.ts):
- vitest config now emits html and json-summary reporters in addition to text + lcov
- Test step now runs 'npx vitest run --coverage --reporter=verbose' so coverage/ is populated on every CI run
- New 'Generate frontend coverage report' step parses coverage/coverage-summary.json with a tiny inline node script and writes a 4-row Markdown table (statements/branches/functions/lines) to GITHUB_STEP_SUMMARY
- New 'Upload coverage' step publishes web/coverage/ (which includes the v8 HTML report at coverage/index.html, lcov.info for external tools, and the JSON summaries) as the frontend-coverage artifact
.gitignore: adds coverage.txt, coverage-by-package.txt, web/coverage/ so local runs of the new reports don't accidentally get committed.
Verified locally (Windows + Git for Windows awk/sort/grep):
- go tool cover -func + the awk rollup produces correct per-package percentages against a subset coverage.out
- vitest run --coverage produces coverage/coverage-summary.json with the expected 'total' shape
- The node summary script renders the markdown table cleanly
- The HTML reports (coverage.html and web/coverage/index.html) render correctly
How to consume after this lands:
- Quick read: open the CI run → 'Summary' tab shows backend total + frontend table inline
- Deep dive: download the backend-coverage or frontend-coverage artifact, open coverage.html or coverage/index.html in a browser
- External tools: lcov.info inside frontend-coverage is the standard format for Codecov/Coveralls/SonarQube if you choose to wire one of those up later
Net change: 3 files, +82/-5. No behavioural change to gating — tests still pass/fail on their own merits; coverage publishing is metadata-only and uses if: always() so it never masks test failures.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent fa7440a commit 05243c6
3 files changed
Lines changed: 82 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
59 | 96 | | |
60 | 97 | | |
61 | 98 | | |
| |||
91 | 128 | | |
92 | 129 | | |
93 | 130 | | |
| 131 | + | |
94 | 132 | | |
95 | 133 | | |
96 | | - | |
97 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
98 | 140 | | |
99 | 141 | | |
100 | 142 | | |
| |||
115 | 157 | | |
116 | 158 | | |
117 | 159 | | |
118 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
119 | 191 | | |
120 | 192 | | |
121 | 193 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
61 | 66 | | |
62 | 67 | | |
63 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| |||
0 commit comments