mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
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:
@@ -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,6 +7,7 @@ A self-hosted library management and reading platform for ebooks, PDFs, audioboo
|
||||
[](https://github.com/bookorbit/bookorbit/stargazers)
|
||||
[](https://github.com/bookorbit/bookorbit/actions/workflows/ci.yml)
|
||||
[](https://github.com/bookorbit/bookorbit/actions/workflows/release.yml)
|
||||
[](https://codecov.io/gh/bookorbit/bookorbit)
|
||||
[](https://github.com/bookorbit/bookorbit/releases)
|
||||
[](https://github.com/bookorbit/bookorbit/commits/main)
|
||||
[](LICENSE)
|
||||
@@ -27,8 +28,6 @@ A self-hosted library management and reading platform for ebooks, PDFs, audioboo
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## 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
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## Support
|
||||
|
||||
- **Questions and discussion:** [GitHub Discussions](https://github.com/bookorbit/bookorbit/discussions)
|
||||
|
||||
@@ -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
@@ -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
|
||||
Reference in New Issue
Block a user