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() &&
+7 -2
View File
@@ -7,6 +7,7 @@ A self-hosted library management and reading platform for ebooks, PDFs, audioboo
[![Stars](https://img.shields.io/github/stars/bookorbit/bookorbit?style=flat)](https://github.com/bookorbit/bookorbit/stargazers)
[![CI](https://github.com/bookorbit/bookorbit/actions/workflows/ci.yml/badge.svg)](https://github.com/bookorbit/bookorbit/actions/workflows/ci.yml)
[![Release](https://github.com/bookorbit/bookorbit/actions/workflows/release.yml/badge.svg)](https://github.com/bookorbit/bookorbit/actions/workflows/release.yml)
[![codecov](https://codecov.io/gh/bookorbit/bookorbit/graph/badge.svg?token=F6TADEFCUV)](https://codecov.io/gh/bookorbit/bookorbit)
[![Latest release](https://img.shields.io/github/v/release/bookorbit/bookorbit?label=latest)](https://github.com/bookorbit/bookorbit/releases)
[![Commits/month](https://img.shields.io/github/commit-activity/m/bookorbit/bookorbit?label=commits%2Fmonth)](https://github.com/bookorbit/bookorbit/commits/main)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](LICENSE)
@@ -27,8 +28,6 @@ A self-hosted library management and reading platform for ebooks, PDFs, audioboo
![BookOrbit dashboard showing reading stats, widgets, and book shelves](https://bookorbit.app/images/home/dashboard-overview.webp)
---
## What is BookOrbit?
BookOrbit is a self-hosted digital library and reading platform. Organize and read your books, sync seamlessly with Kobo and KOReader devices, enrich your collection with metadata from multiple providers, and support multiple users with OIDC/SSO authentication and detailed reading statistics. Built-in features include OPDS support, customizable dashboard widgets, Send-to-Kindle delivery, and Smart Scopes for dynamic rule-based shelves and filters - all running on infrastructure you control.
@@ -124,6 +123,12 @@ For local development, see [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md). To contri
---
## Code Coverage Map
![Codecov Grid](https://codecov.io/gh/bookorbit/bookorbit/graphs/tree.svg?token=F6TADEFCUV)
---
## Support
- **Questions and discussion:** [GitHub Discussions](https://github.com/bookorbit/bookorbit/discussions)
+3 -1
View File
@@ -11,8 +11,10 @@ export default mergeConfig(
root: fileURLToPath(new URL('./', import.meta.url)),
coverage: {
provider: 'v8',
reporter: ['text', 'html'],
reporter: ['text', 'html', 'lcov'],
reportsDirectory: './coverage',
include: ['src/**/*.{ts,vue}'],
exclude: ['src/**/*.test.ts', 'src/**/*.spec.ts', 'src/**/__tests__/**', 'src/main.ts', 'src/**/*.d.ts', 'src/**/*.types.ts'],
thresholds: {
lines: 1,
statements: 1,
+61
View File
@@ -0,0 +1,61 @@
coverage:
status:
project:
default:
target: auto
threshold: 0%
base: auto
flags:
- server
- client
server:
target: auto
threshold: 0%
base: auto
flags:
- server
client:
target: auto
threshold: 0%
base: auto
flags:
- client
patch:
default:
target: auto
threshold: 0%
base: auto
flags:
- server
- client
server:
target: auto
threshold: 0%
base: auto
flags:
- server
client:
target: auto
threshold: 0%
base: auto
flags:
- client
comment:
layout: "diff, flags, files"
behavior: default
require_changes: false
require_base: false
require_head: true
hide_project_coverage: false
show_carryforward_flags: true
flags:
server:
paths:
- server/**
carryforward: true
client:
paths:
- client/**
carryforward: true