Skip to content

Commit e8c5430

Browse files
committed
feat: integrate Codecov coverage reporting for monorepo
Add coverage collection to CI test steps (backend, frontend, plugin) and upload reports to Codecov with per-workspace flags. Add codecov.yml with flag-based path mappings and carryforward support.
1 parent 119a698 commit e8c5430

File tree

4 files changed

+363
-4
lines changed

4 files changed

+363
-4
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,16 @@ jobs:
4646
- run: npm run build --workspace=packages/backend
4747
- name: Test migrations
4848
run: npm run migration:run --workspace=packages/backend
49-
- run: npm test --workspace=packages/backend
50-
- run: npm run test:e2e --workspace=packages/backend
49+
- run: npm test --workspace=packages/backend -- --coverage --coverageReporters=lcov
50+
- run: npm run test:e2e --workspace=packages/backend -- --coverage --coverageReporters=lcov
51+
- name: Upload backend coverage to Codecov
52+
if: always()
53+
uses: codecov/codecov-action@v5
54+
with:
55+
token: ${{ secrets.CODECOV_TOKEN }}
56+
flags: backend
57+
directory: packages/backend
58+
fail_ci_if_error: false
5159

5260
backend-sqlite:
5361
name: Backend (SQLite)
@@ -82,9 +90,17 @@ jobs:
8290
- run: npm ci
8391
- run: npx tsc --noEmit
8492
working-directory: packages/frontend
85-
- run: npm test --workspace=packages/frontend
93+
- run: npm test --workspace=packages/frontend -- --coverage
8694
- run: npx vite build
8795
working-directory: packages/frontend
96+
- name: Upload frontend coverage to Codecov
97+
if: always()
98+
uses: codecov/codecov-action@v5
99+
with:
100+
token: ${{ secrets.CODECOV_TOKEN }}
101+
flags: frontend
102+
directory: packages/frontend/coverage
103+
fail_ci_if_error: false
88104

89105
plugin:
90106
runs-on: ubuntu-latest
@@ -95,7 +111,15 @@ jobs:
95111
node-version: 22
96112
cache: npm
97113
- run: npm ci
98-
- run: npm test --workspace=packages/openclaw-plugin
114+
- run: npm test --workspace=packages/openclaw-plugin -- --coverage --coverageReporters=lcov
115+
- name: Upload plugin coverage to Codecov
116+
if: always()
117+
uses: codecov/codecov-action@v5
118+
with:
119+
token: ${{ secrets.CODECOV_TOKEN }}
120+
flags: plugin
121+
directory: packages/openclaw-plugin
122+
fail_ci_if_error: false
99123

100124
changeset-check:
101125
name: Changeset status

codecov.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
target: auto
6+
patch:
7+
default:
8+
target: auto
9+
flags:
10+
backend:
11+
paths:
12+
- packages/backend/src/
13+
carryforward: true
14+
frontend:
15+
paths:
16+
- packages/frontend/src/
17+
carryforward: true
18+
plugin:
19+
paths:
20+
- packages/openclaw-plugin/src/
21+
carryforward: true
22+
comment:
23+
layout: "reach,diff,flags"

0 commit comments

Comments
 (0)