Skip to content

Commit c5d8c22

Browse files
committed
ci(workflow): 添加代码格式和质量检查的GitHub Actions配置
- 新增GitHub Actions工作流文件lint.yml - 配置在main和master分支的push和pull_request事件触发 - 设置运行环境为最新Ubuntu并安装Node.js 20 - 包含npm依赖安装步骤 - 增加格式检查、代码质量检查、类型检查和测试执行步骤 - 通过自动化保证代码质量和一致性
1 parent 3d3740f commit c5d8c22

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

.github/workflows/lint.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Lint & Format Check
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 20
18+
cache: npm
19+
20+
- run: npm ci
21+
22+
- name: Check formatting
23+
run: npm run format:check
24+
25+
- name: Check code quality
26+
run: npm run lint
27+
28+
- name: Type check
29+
run: npm run typecheck
30+
31+
- name: Run tests
32+
run: npm test

0 commit comments

Comments
 (0)