Skip to content

Commit 18b8224

Browse files
committed
ci: add codecov coverage reporting and badge
1 parent 0e595d9 commit 18b8224

4 files changed

Lines changed: 52 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,17 @@ jobs:
3232
- name: Lint
3333
run: pnpm run lint
3434

35-
- name: Test
36-
run: pnpm run test
35+
- name: Test with coverage
36+
run: pnpm run test -- --coverage
37+
38+
- name: Upload coverage to Codecov
39+
uses: codecov/codecov-action@v4
40+
with:
41+
token: ${{ secrets.CODECOV_TOKEN }}
42+
files: ./coverage/lcov.info
43+
flags: unittests
44+
fail_ci_if_error: false
45+
verbose: true
3746

3847
- name: Type check
3948
run: pnpm run typecheck

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
[![npm version](https://img.shields.io/npm/v/@framers/agentos?style=flat-square&logo=npm&color=cb3837)](https://www.npmjs.com/package/@framers/agentos)
1212
[![CI](https://img.shields.io/github/actions/workflow/status/framersai/agentos/ci.yml?style=flat-square&logo=github&label=CI)](https://github.com/framersai/agentos/actions)
13+
[![codecov](https://codecov.io/gh/framersai/agentos/graph/badge.svg?token=YOUR_CODECOV_TOKEN)](https://codecov.io/gh/framersai/agentos)
1314
[![TypeScript](https://img.shields.io/badge/TypeScript-5.4+-3178c6?style=flat-square&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
1415
[![License](https://img.shields.io/badge/License-Apache_2.0-blue?style=flat-square)](https://opensource.org/licenses/Apache-2.0)
1516

@@ -163,13 +164,13 @@ await agent.initialize({
163164
tools: [{
164165
name: 'get_weather',
165166
description: 'Get current weather for a city',
166-
parameters: {
167-
type: 'object',
168-
properties: {
167+
parameters: {
168+
type: 'object',
169+
properties: {
169170
city: { type: 'string' }
170-
},
171-
required: ['city']
172171
},
172+
required: ['city']
173+
},
173174
execute: async ({ city }) => {
174175
const res = await fetch(`https://api.weather.com/${city}`);
175176
return res.json();
@@ -181,7 +182,7 @@ await agent.initialize({
181182
for await (const chunk of agent.processRequest({ message: 'Weather in Tokyo?' })) {
182183
if (chunk.type === 'tool_call') console.log('Calling:', chunk.tool);
183184
if (chunk.type === 'content') process.stdout.write(chunk.content);
184-
}
185+
}
185186
```
186187

187188
### Multiple Providers

codecov.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
codecov:
2+
require_ci_to_pass: true
3+
4+
coverage:
5+
precision: 2
6+
round: down
7+
range: "60...90"
8+
status:
9+
project:
10+
default:
11+
target: auto
12+
threshold: 2%
13+
patch:
14+
default:
15+
target: auto
16+
threshold: 5%
17+
18+
parsers:
19+
gcov:
20+
branch_detection:
21+
conditional: yes
22+
loop: yes
23+
method: no
24+
macro: no
25+
26+
comment:
27+
layout: "reach,diff,flags,tree,betaprofiling"
28+
behavior: default
29+
require_changes: no
30+
require_base: no
31+
require_head: yes

docs/RELEASING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,6 @@ Fix tests locally before releasing. Do not skip tests.
149149

150150

151151

152+
153+
154+

0 commit comments

Comments
 (0)