From 6da6d2b22cf1b2439013a11a8ccd1192c63238a6 Mon Sep 17 00:00:00 2001 From: Sergio Arroutbi Date: Wed, 13 May 2026 22:23:28 +0200 Subject: [PATCH] Add coverage summary and artifact upload to CI Post a coverage table (statements, branches, functions, lines) to the GitHub Actions job summary, matching the frontend repo pattern. Upload the full coverage/ directory as a downloadable artifact. Co-Authored-By: Claude Opus 4.6 Signed-off-by: Sergio Arroutbi --- .github/workflows/coverage.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index cd136fc..a496fb3 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -21,3 +21,30 @@ jobs: - name: Run tests with coverage run: npm run test:coverage + + - name: Report coverage + if: always() + run: | + set -eu + node -e " + const s = require('./coverage/coverage-summary.json').total; + const lines = [ + '## Code Coverage', + '', + '| Metric | Coverage |', + '|--------|----------|', + '| **Statements** | **' + s.statements.pct + '%** |', + '| Branches | ' + s.branches.pct + '% |', + '| Functions | ' + s.functions.pct + '% |', + '| Lines | ' + s.lines.pct + '% |', + '', + '> ' + s.lines.covered + '/' + s.lines.total + ' lines covered', + ]; + console.log(lines.join('\n')); + " >> "$GITHUB_STEP_SUMMARY" + + - uses: actions/upload-artifact@v4 + if: always() + with: + name: coverage-report + path: coverage/