Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Check

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

jobs:
check:
name: Quality gate
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Check out repository
uses: actions/checkout@v7

- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Run quality gate
run: bun run check

- name: Report test coverage
run: bun run test:coverage
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ The root `package.json` is the source of truth for project commands:
| `bun run lint:staged` | Run the pre-commit checks against Git-staged files. |
| `bun run prepare` | Install the repository-managed Husky hooks. |
| `bun test` | Run every test under the top-level `tests/` directory. |
| `bun run test:coverage` | Run every test and print the Bun coverage report. |
| `bun run typecheck` | Type-check both `src/` and `tests/` without emitting files. |
| `bun run check` | Run type-checking, lint, format checks, and the complete test suite. |

Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ The root `package.json` is the source of truth for project commands:
| `bun run lint:staged` | Run pre-commit checks against Git-staged files. |
| `bun run prepare` | Install the repository-managed Husky hooks. |
| `bun test` | Run every test under the top-level `tests/` directory. |
| `bun run test:coverage` | Run every test and print the Bun coverage report. |
| `bun run typecheck` | Type-check `src/` and `tests/` without emitting files. |
| `bun run check` | Run type-checking, lint, formatting, and all tests. |

Expand Down
1 change: 1 addition & 0 deletions docs/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ bun run check
| `bun run lint:staged` | 对 Git 暂存文件运行 pre-commit 检查。 |
| `bun run prepare` | 安装仓库管理的 Husky Hooks。 |
| `bun test` | 运行顶层 `tests/` 目录下的全部测试。 |
| `bun run test:coverage` | 运行全部测试并输出 Bun 覆盖率报告。 |
| `bun run typecheck` | 对 `src/` 和 `tests/` 执行类型检查,但不输出文件。 |
| `bun run check` | 运行类型检查、Lint、格式检查和全部测试。 |

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"format:check": "prettier . --check",
"lint:staged": "lint-staged",
"test": "bun test",
"test:coverage": "bun test --coverage",
"typecheck": "bunx tsc --noEmit",
"check": "bun run typecheck && bun run lint && bun run format:check && bun test",
"prepare": "husky"
Expand Down