Skip to content

Commit 7481621

Browse files
authored
ci: enforce lint and report coverage on PRs (#156)
## What changed - **Lint in CI**: added a plain `pnpm exec oxlint` step to the `test` job. The existing `lint` script is `oxlint --fix` (mutating), so CI runs the non-mutating variant. There is no oxlint config file, which is fine — oxlint applies its defaults. - **Coverage config** (`vite.config.ts`): the coverage block was defined but not `enabled`, and its `reporter` list lacked `json-summary` (required by the report action). Added `enabled: true`, `reportOnFailure: true`, and `json-summary` to the reporter list. Provider/include/exclude unchanged. - **Coverage reporting**: added the SHA-pinned `davelosert/vitest-coverage-report-action@…3c50566 # v2` step (`if: always()`, `pr-number: auto`) matching codemirror-mcp. The job already has `pull-requests: write`. ## Why The lint script and a coverage config already existed but CI never ran lint, and coverage was neither enabled nor emitting the `json-summary` the reporter needs — so coverage was effectively invisible on PRs. This turns both into visible PR gates. ## How verified - `pnpm install --frozen-lockfile` - `pnpm exec oxlint` — exit 0 (1 pre-existing `no-unused-expressions` warning, non-blocking; no source changes needed) - `pnpm run test` — 206 passed + 1 expected-fail across 11 test files (including the Playwright browser project); `coverage/coverage-summary.json` is generated and `coverage/` is gitignored. No mechanical source fixes were required. Part of the marimo-team engineering-excellence initiative to make existing-but-unenforced quality gates actually run in CI.
1 parent 749da92 commit 7481621

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/test.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,21 @@ jobs:
3535
- name: 📥 Install dependencies
3636
run: pnpm install --ignore-scripts --frozen-lockfile
3737

38+
- name: 🧹 Lint
39+
run: pnpm exec oxlint
40+
3841
- name: 🔍 Type Check
3942
run: pnpm run typecheck
4043

4144
- name: 🧪 Test
4245
run: pnpm run test
4346

47+
- name: 📊 Report Coverage
48+
if: always()
49+
uses: davelosert/vitest-coverage-report-action@3c50566c523e04813df28de8f7c48dd97d663f1c # v2
50+
with:
51+
pr-number: auto
52+
4453
security:
4554
runs-on: ubuntu-latest
4655
steps:

vite.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ export default defineConfig({
66
test: {
77
watch: false,
88
coverage: {
9+
enabled: true,
910
provider: "v8",
10-
reporter: ["text", "json", "html"],
11+
reportOnFailure: true,
12+
reporter: ["text", "json", "html", "json-summary"],
1113
include: ["src/**/*.ts"],
1214
exclude: ["src/**/*.test.ts", "src/**/__tests__/**", "src/debug.ts"],
1315
},

0 commit comments

Comments
 (0)