From 2eb8fdf37c14f762eea7525f318653f2026bd34d Mon Sep 17 00:00:00 2001
From: "luke.gao"
Date: Mon, 31 Aug 2026 18:00:23 +0800
Subject: [PATCH 1/3] ci: add GitHub Actions workflow with coverage reporting
Adds CI pipeline (typecheck, build, test, coverage upload to Codecov)
and wires build/coverage badges into the README. Coverage thresholds
in vitest.config.ts are disabled until calibrated against a real run.
---
.github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++
README.md | 2 ++
vitest.config.ts | 16 +++++++---------
3 files changed, 37 insertions(+), 9 deletions(-)
create mode 100644 .github/workflows/ci.yml
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..b5650ec
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,28 @@
+name: CI
+
+on:
+ push:
+ branches: [main]
+ pull_request:
+ branches: [main]
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: pnpm/action-setup@v4
+ with:
+ version: 8.14.1
+ - uses: actions/setup-node@v4
+ with:
+ node-version: '20'
+ cache: 'pnpm'
+ - run: pnpm install --frozen-lockfile
+ - run: pnpm run typecheck
+ - run: pnpm run build
+ - run: pnpm run coverage
+ - uses: codecov/codecov-action@v4
+ with:
+ files: ./coverage/lcov.info
+ fail_ci_if_error: false
diff --git a/README.md b/README.md
index 6c68274..efc4bf4 100644
--- a/README.md
+++ b/README.md
@@ -9,6 +9,8 @@
+
+
diff --git a/vitest.config.ts b/vitest.config.ts
index 0afa1c4..5c6f1b8 100644
--- a/vitest.config.ts
+++ b/vitest.config.ts
@@ -20,15 +20,13 @@ export default defineConfig({
"src/**/*.d.ts",
"src/bin/**", // thin CLI entrypoints
],
- // Provisional floor. These thresholds have NOT been run yet (the offline
- // registry blocks installing @vitest/coverage-v8); calibrate them against
- // the first real `pnpm run coverage` report and adjust as needed.
- thresholds: {
- lines: 80,
- functions: 80,
- statements: 80,
- branches: 75,
- },
+ // Thresholds disabled until calibrated against a real CI coverage run.
+ // thresholds: {
+ // lines: 80,
+ // functions: 80,
+ // statements: 80,
+ // branches: 75,
+ // },
},
},
});
From c0bfd9c2604c63519002f774e6841f409b2ebd81 Mon Sep 17 00:00:00 2001
From: "luke.gao"
Date: Mon, 31 Aug 2026 18:16:38 +0800
Subject: [PATCH 2/3] ci: drop Codecov upload until CODECOV_TOKEN is
provisioned
Tokenless upload is no longer supported by Codecov, so the upload
step failed in CI (harmlessly, due to fail_ci_if_error: false). Keep
coverage running locally in the pipeline for visibility, but drop the
badge and upload step until a real token is set up.
---
.github/workflows/ci.yml | 4 ----
README.md | 1 -
2 files changed, 5 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index b5650ec..0dd0b09 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -22,7 +22,3 @@ jobs:
- run: pnpm run typecheck
- run: pnpm run build
- run: pnpm run coverage
- - uses: codecov/codecov-action@v4
- with:
- files: ./coverage/lcov.info
- fail_ci_if_error: false
diff --git a/README.md b/README.md
index efc4bf4..ddeeeff 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,6 @@
-
From 6499143232f9425e0bc13e44b98858832ac5720d Mon Sep 17 00:00:00 2001
From: "luke.gao"
Date: Tue, 1 Sep 2026 17:43:19 +0800
Subject: [PATCH 3/3] ci: calibrate coverage thresholds from real CI run
Enable thresholds using PR #3's measured coverage (93.02% stmts,
90.65% branch, 96.62% funcs, 93.02% lines) minus a safety margin.
---
vitest.config.ts | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/vitest.config.ts b/vitest.config.ts
index 5c6f1b8..9260c70 100644
--- a/vitest.config.ts
+++ b/vitest.config.ts
@@ -20,13 +20,13 @@ export default defineConfig({
"src/**/*.d.ts",
"src/bin/**", // thin CLI entrypoints
],
- // Thresholds disabled until calibrated against a real CI coverage run.
- // thresholds: {
- // lines: 80,
- // functions: 80,
- // statements: 80,
- // branches: 75,
- // },
+ // Calibrated against the CI run in PR #3 (93.02% stmts / 90.65% branch / 96.62% funcs / 93.02% lines).
+ thresholds: {
+ lines: 85,
+ functions: 90,
+ statements: 85,
+ branches: 85,
+ },
},
},
});