ci: upload server and client coverage reports to codecov (#183)

* ci: upload server and client coverage reports to codecov

Generate client lcov output and publish per-package coverage from CI so Codecov checks and README coverage artifacts stay up to date.

* ci: configure codecov project status and pr comments

* ci: isolate codecov coverage status by flags

* ci: add patch coverage status, per-flag badges, and client coverage scope

- Add patch coverage status in codecov.yml (server and client flags) so
  Codecov checks coverage on changed lines in PRs, not just overall trend
- Add include/exclude patterns to client vitest coverage config so test
  files and entry points are excluded from coverage stats
- Add per-flag server/client coverage badges to the README coverage section

* docs: restructure coverage map in README

Move the coverage map down to the documentation and contributing section, giving it its own heading. Remove the redundant server and client badges from the top.
This commit is contained in:
neon
2026-05-31 21:41:42 -06:00
committed by GitHub
parent 16e01f6b01
commit 7fca7af9d4
4 changed files with 84 additions and 4 deletions
+13 -1
View File
@@ -392,6 +392,8 @@ jobs:
permissions:
contents: read
checks: write
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Check for package changes
id: has-changes
@@ -435,9 +437,19 @@ jobs:
if [[ "$PACKAGE" == "server" ]]; then
pnpm --filter server exec vitest --run --coverage --reporter=default --reporter=github-actions --reporter=junit --outputFile.junit="$JUNIT_OUTPUT"
else
pnpm --filter client exec vitest --run --reporter=default --reporter=junit --outputFile="$JUNIT_OUTPUT"
pnpm --filter client exec vitest --run --coverage --reporter=default --reporter=junit --outputFile="$JUNIT_OUTPUT"
fi
- name: Upload coverage reports to Codecov
if: steps.has-changes.outputs.run == 'true' && env.CODECOV_TOKEN != ''
uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5
with:
token: ${{ env.CODECOV_TOKEN }}
files: ${{ matrix.package == 'server' && 'server/coverage/lcov.info' || 'client/coverage/lcov.info' }}
flags: ${{ matrix.package }}
name: ${{ matrix.package }}-coverage
verbose: true
- name: Publish test report annotations
if: >
always() &&