From e5c82bb0d16157d8b83cdf7dbd27e3adf4c3a2d6 Mon Sep 17 00:00:00 2001 From: JackChen Date: Sun, 19 Apr 2026 18:00:23 +0800 Subject: [PATCH] chore: add real badges and wire up codecov (#127) - Replace the static fake coverage badge with codecov. - Add npm version and bundlephobia bundle-size badges. - Add test:coverage script and lcov reporter so CI can upload. - Add a coverage job in CI that uploads to codecov on Node 20. Requires CODECOV_TOKEN secret to be set in the repo for the badge to populate; until then the badge will display "unknown". --- .github/workflows/ci.yml | 16 ++++++++++++++++ README.md | 6 ++++-- README_zh.md | 6 ++++-- package.json | 1 + vitest.config.ts | 1 + 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39c0cc7..6ed9871 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,3 +21,19 @@ jobs: - run: rm -f package-lock.json && npm install - run: npm run lint - run: npm test + + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + - run: rm -f package-lock.json && npm install + - run: npm run test:coverage + - uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage/lcov.info + fail_ci_if_error: false diff --git a/README.md b/README.md index f872a23..b8735c0 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,12 @@ The lightweight multi-agent orchestration engine for TypeScript. Three runtime d CrewAI is Python. LangGraph makes you draw the graph by hand. `open-multi-agent` is the `npm install` you drop into an existing Node.js backend when you need a team of agents to work on a goal together. Nothing more, nothing less. +[![npm version](https://img.shields.io/npm/v/@jackchen_me/open-multi-agent)](https://www.npmjs.com/package/@jackchen_me/open-multi-agent) [![GitHub stars](https://img.shields.io/github/stars/JackChen-me/open-multi-agent)](https://github.com/JackChen-me/open-multi-agent/stargazers) [![license](https://img.shields.io/github/license/JackChen-me/open-multi-agent)](./LICENSE) [![TypeScript](https://img.shields.io/badge/TypeScript-5.6-blue)](https://www.typescriptlang.org/) -[![coverage](https://img.shields.io/badge/coverage-85%25-brightgreen)](https://github.com/JackChen-me/open-multi-agent/actions) +[![bundle size](https://img.shields.io/bundlephobia/minzip/@jackchen_me/open-multi-agent)](https://bundlephobia.com/package/@jackchen_me/open-multi-agent) +[![codecov](https://codecov.io/gh/JackChen-me/open-multi-agent/graph/badge.svg)](https://codecov.io/gh/JackChen-me/open-multi-agent) **English** | [中文](./README_zh.md) @@ -456,7 +458,7 @@ Issues, feature requests, and PRs are welcome. Some areas where contributions wo ## Contributors - + ## Star History diff --git a/README_zh.md b/README_zh.md index 8d26d5c..32690f1 100644 --- a/README_zh.md +++ b/README_zh.md @@ -4,10 +4,12 @@ TypeScript 里的轻量多智能体编排引擎。3 个运行时依赖,零配 CrewAI 是 Python。LangGraph 要你自己画图。`open-multi-agent` 是你现有 Node.js 后端里 `npm install` 一下就能用的那一层:一支 agent 团队围绕一个目标协作,就这些。 +[![npm version](https://img.shields.io/npm/v/@jackchen_me/open-multi-agent)](https://www.npmjs.com/package/@jackchen_me/open-multi-agent) [![GitHub stars](https://img.shields.io/github/stars/JackChen-me/open-multi-agent)](https://github.com/JackChen-me/open-multi-agent/stargazers) [![license](https://img.shields.io/github/license/JackChen-me/open-multi-agent)](./LICENSE) [![TypeScript](https://img.shields.io/badge/TypeScript-5.6-blue)](https://www.typescriptlang.org/) -[![coverage](https://img.shields.io/badge/coverage-85%25-brightgreen)](https://github.com/JackChen-me/open-multi-agent/actions) +[![bundle size](https://img.shields.io/bundlephobia/minzip/@jackchen_me/open-multi-agent)](https://bundlephobia.com/package/@jackchen_me/open-multi-agent) +[![codecov](https://codecov.io/gh/JackChen-me/open-multi-agent/graph/badge.svg)](https://codecov.io/gh/JackChen-me/open-multi-agent) [English](./README.md) | **中文** @@ -451,7 +453,7 @@ Issue、feature request、PR 都欢迎。特别想要: ## 贡献者 - + ## Star 趋势 diff --git a/package.json b/package.json index 6155283..ae96f59 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "dev": "tsc --watch", "test": "vitest run", "test:watch": "vitest", + "test:coverage": "vitest run --coverage", "lint": "tsc --noEmit", "test:e2e": "RUN_E2E=1 vitest run tests/e2e/", "prepublishOnly": "npm run build" diff --git a/vitest.config.ts b/vitest.config.ts index bbc79ff..d6c2252 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -4,6 +4,7 @@ export default defineConfig({ test: { coverage: { include: ['src/**'], + reporter: ['text', 'html', 'lcov', 'json'], }, exclude: [ '**/node_modules/**',