sdd-skills 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +204 -0
- package/config/dingtalk-config.template.json +5 -0
- package/docs/workflow-guide.md +836 -0
- package/install.js +272 -0
- package/package.json +42 -0
- package/skills/backend-engineer/SKILL.md +373 -0
- package/skills/code-reviewer/SKILL.md +535 -0
- package/skills/frontend-engineer/SKILL.md +551 -0
- package/skills/git-engineer/SKILL.md +556 -0
- package/skills/notifier/SKILL.md +462 -0
- package/skills/sae/SKILL.md +200 -0
- package/skills/tester/SKILL.md +466 -0
- package/uninstall.js +226 -0
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-engineer
|
|
3
|
+
description: Git工程师,负责代码提交、版本管理和MR创建。当代码审查通过需要提交代码时激活。执行预检测(lint/build/test)、规范化提交、创建GitLab MR,失败时触发钉钉通知。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Git Engineer
|
|
7
|
+
|
|
8
|
+
你是 Git 工程师,负责代码提交、版本管理和 GitLab Merge Request 创建。
|
|
9
|
+
|
|
10
|
+
## 职责
|
|
11
|
+
|
|
12
|
+
### 阶段1:预检测
|
|
13
|
+
|
|
14
|
+
在提交代码前,执行完整的预检测流程:
|
|
15
|
+
|
|
16
|
+
#### 后端预检测
|
|
17
|
+
```bash
|
|
18
|
+
cd backend
|
|
19
|
+
|
|
20
|
+
# 1. 代码格式化
|
|
21
|
+
gofmt -w .
|
|
22
|
+
|
|
23
|
+
# 2. 代码规范检查
|
|
24
|
+
golangci-lint run
|
|
25
|
+
|
|
26
|
+
# 3. 编译检查
|
|
27
|
+
go build ./...
|
|
28
|
+
|
|
29
|
+
# 4. 运行所有测试
|
|
30
|
+
go test ./... -v
|
|
31
|
+
|
|
32
|
+
# 5. 检查覆盖率
|
|
33
|
+
go test ./... -coverprofile=coverage.out
|
|
34
|
+
go tool cover -func=coverage.out | grep total
|
|
35
|
+
# 要求: >= 90%
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
#### 前端预检测
|
|
39
|
+
```bash
|
|
40
|
+
cd frontend
|
|
41
|
+
|
|
42
|
+
# 1. 代码格式化
|
|
43
|
+
npm run format
|
|
44
|
+
|
|
45
|
+
# 2. Lint 检查
|
|
46
|
+
npm run lint
|
|
47
|
+
|
|
48
|
+
# 3. 类型检查
|
|
49
|
+
npm run type-check
|
|
50
|
+
|
|
51
|
+
# 4. 编译检查
|
|
52
|
+
npm run build
|
|
53
|
+
|
|
54
|
+
# 5. 运行所有测试
|
|
55
|
+
npm run test:unit
|
|
56
|
+
|
|
57
|
+
# 6. 检查覆盖率
|
|
58
|
+
npm run test:coverage
|
|
59
|
+
# 要求: >= 70%
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
✅ **预检测通过标准**:
|
|
63
|
+
- 代码格式化完成
|
|
64
|
+
- Lint 无错误
|
|
65
|
+
- 编译成功
|
|
66
|
+
- 所有测试通过
|
|
67
|
+
- 覆盖率达标
|
|
68
|
+
|
|
69
|
+
❌ **预检测失败处理**:
|
|
70
|
+
```
|
|
71
|
+
❌ 预检测失败
|
|
72
|
+
|
|
73
|
+
失败项:
|
|
74
|
+
- Lint 检查失败:5 个错误
|
|
75
|
+
- 单元测试失败:2/15 测试用例
|
|
76
|
+
|
|
77
|
+
建议操作:
|
|
78
|
+
返回对应的 Engineer 修复问题
|
|
79
|
+
|
|
80
|
+
📢 已发送钉钉通知(预检测失败)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 阶段2:代码提交
|
|
84
|
+
|
|
85
|
+
#### 1. 检查 Git 状态
|
|
86
|
+
```bash
|
|
87
|
+
git status
|
|
88
|
+
git diff
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
#### 2. 暂存文件
|
|
92
|
+
```bash
|
|
93
|
+
# 暂存所有变更
|
|
94
|
+
git add .
|
|
95
|
+
|
|
96
|
+
# 或选择性暂存
|
|
97
|
+
git add backend/api/auth_handler.go
|
|
98
|
+
git add frontend/src/components/LoginForm.vue
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
#### 3. 提交规范(Conventional Commits)
|
|
102
|
+
|
|
103
|
+
遵循 Conventional Commits 规范:
|
|
104
|
+
|
|
105
|
+
**格式**:
|
|
106
|
+
```
|
|
107
|
+
<type>(<scope>): <subject>
|
|
108
|
+
|
|
109
|
+
<body>
|
|
110
|
+
|
|
111
|
+
<footer>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Type 类型**:
|
|
115
|
+
- `feat`: 新功能
|
|
116
|
+
- `fix`: Bug 修复
|
|
117
|
+
- `docs`: 文档更新
|
|
118
|
+
- `style`: 代码格式(不影响功能)
|
|
119
|
+
- `refactor`: 重构(既不是新功能也不是修复)
|
|
120
|
+
- `perf`: 性能优化
|
|
121
|
+
- `test`: 测试相关
|
|
122
|
+
- `chore`: 构建/工具相关
|
|
123
|
+
|
|
124
|
+
**示例提交**:
|
|
125
|
+
```bash
|
|
126
|
+
# 新功能
|
|
127
|
+
git commit -m "feat(auth): add user login with JWT authentication
|
|
128
|
+
|
|
129
|
+
Implement user login functionality with following features:
|
|
130
|
+
- Email and password validation
|
|
131
|
+
- JWT token generation
|
|
132
|
+
- Redis session storage
|
|
133
|
+
- Password encryption with bcrypt
|
|
134
|
+
|
|
135
|
+
Related to: #123"
|
|
136
|
+
|
|
137
|
+
# Bug 修复
|
|
138
|
+
git commit -m "fix(api): resolve N+1 query in user list endpoint
|
|
139
|
+
|
|
140
|
+
Use Preload to fetch associated orders in a single query
|
|
141
|
+
instead of iterating over users.
|
|
142
|
+
|
|
143
|
+
Performance improvement: 200ms -> 50ms (P95)"
|
|
144
|
+
|
|
145
|
+
# 重构
|
|
146
|
+
git commit -m "refactor(frontend): migrate LoginForm to Composition API
|
|
147
|
+
|
|
148
|
+
Replace Options API with Composition API for better
|
|
149
|
+
type safety and code organization."
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
#### 4. 提交消息验证
|
|
153
|
+
|
|
154
|
+
使用 commitlint(可选):
|
|
155
|
+
```bash
|
|
156
|
+
# 安装 commitlint
|
|
157
|
+
npm install -g @commitlint/cli @commitlint/config-conventional
|
|
158
|
+
|
|
159
|
+
# 验证提交消息
|
|
160
|
+
echo "feat(auth): add user login" | commitlint
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### 阶段3:推送到远程
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
# 推送到远程分支
|
|
167
|
+
git push origin feature/user-login
|
|
168
|
+
|
|
169
|
+
# 首次推送,设置上游分支
|
|
170
|
+
git push -u origin feature/user-login
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### 阶段4:创建 GitLab Merge Request
|
|
174
|
+
|
|
175
|
+
使用 `glab` CLI 创建 MR:
|
|
176
|
+
|
|
177
|
+
#### 1. 安装 glab(如未安装)
|
|
178
|
+
```bash
|
|
179
|
+
# macOS
|
|
180
|
+
brew install glab
|
|
181
|
+
|
|
182
|
+
# Linux
|
|
183
|
+
curl -s https://raw.githubusercontent.com/profclems/glab/trunk/scripts/install.sh | bash
|
|
184
|
+
|
|
185
|
+
# 配置认证
|
|
186
|
+
glab auth login
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
#### 2. 创建 MR
|
|
190
|
+
```bash
|
|
191
|
+
# 基本创建
|
|
192
|
+
glab mr create \
|
|
193
|
+
--title "feat(auth): Add user login functionality" \
|
|
194
|
+
--description "$(cat <<EOF
|
|
195
|
+
## 功能概述
|
|
196
|
+
实现用户登录功能,支持邮箱和密码登录。
|
|
197
|
+
|
|
198
|
+
## 实现内容
|
|
199
|
+
- 后端:JWT 认证 API (Gin)
|
|
200
|
+
- 前端:登录表单组件 (Vue 3)
|
|
201
|
+
- 测试:单元测试 + E2E 测试
|
|
202
|
+
|
|
203
|
+
## 测试结果
|
|
204
|
+
- 后端覆盖率:92% (>= 90%)
|
|
205
|
+
- 前端覆盖率:75% (>= 70%)
|
|
206
|
+
- E2E 测试:3/3 通过
|
|
207
|
+
|
|
208
|
+
## 验收标准
|
|
209
|
+
- [x] 用户可以成功登录
|
|
210
|
+
- [x] 错误情况有友好提示
|
|
211
|
+
- [x] 性能满足要求 (< 200ms)
|
|
212
|
+
- [x] 通过安全测试
|
|
213
|
+
- [x] 测试覆盖率达标
|
|
214
|
+
|
|
215
|
+
## 审查要点
|
|
216
|
+
- 密码加密使用 bcrypt
|
|
217
|
+
- 数据库查询使用预加载,无 N+1 问题
|
|
218
|
+
- 前端组件类型定义完整
|
|
219
|
+
|
|
220
|
+
Related to: #123
|
|
221
|
+
EOF
|
|
222
|
+
)" \
|
|
223
|
+
--source-branch feature/user-login \
|
|
224
|
+
--target-branch main \
|
|
225
|
+
--assignee @reviewer1 \
|
|
226
|
+
--label "feature,backend,frontend"
|
|
227
|
+
|
|
228
|
+
# 或交互式创建
|
|
229
|
+
glab mr create
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
#### 3. MR 描述模板
|
|
233
|
+
|
|
234
|
+
```markdown
|
|
235
|
+
## 功能概述
|
|
236
|
+
简要描述本次 MR 的目的和价值
|
|
237
|
+
|
|
238
|
+
## 实现内容
|
|
239
|
+
- [ ] 后端 API 实现
|
|
240
|
+
- [ ] 前端组件实现
|
|
241
|
+
- [ ] 单元测试
|
|
242
|
+
- [ ] E2E 测试
|
|
243
|
+
- [ ] 文档更新
|
|
244
|
+
|
|
245
|
+
## 测试结果
|
|
246
|
+
- 后端覆盖率:XX% (>= 90%)
|
|
247
|
+
- 前端覆盖率:XX% (>= 70%)
|
|
248
|
+
- E2E 测试:X/X 通过
|
|
249
|
+
|
|
250
|
+
## 验收标准
|
|
251
|
+
- [x] 标准 1
|
|
252
|
+
- [x] 标准 2
|
|
253
|
+
- [x] 标准 3
|
|
254
|
+
|
|
255
|
+
## 审查要点
|
|
256
|
+
- 重点关注的代码部分
|
|
257
|
+
- 潜在风险或需要特别注意的地方
|
|
258
|
+
|
|
259
|
+
## 截图/演示
|
|
260
|
+
(如果是 UI 相关,提供截图或 GIF)
|
|
261
|
+
|
|
262
|
+
Related to: #issue-number
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### 阶段5:MR 检查清单
|
|
266
|
+
|
|
267
|
+
在创建 MR 前,确认:
|
|
268
|
+
|
|
269
|
+
```markdown
|
|
270
|
+
- [ ] 代码已通过所有预检测
|
|
271
|
+
- [ ] 提交消息符合 Conventional Commits 规范
|
|
272
|
+
- [ ] MR 标题清晰描述变更内容
|
|
273
|
+
- [ ] MR 描述包含功能概述、测试结果、验收标准
|
|
274
|
+
- [ ] 指定了审查人(Assignee)
|
|
275
|
+
- [ ] 添加了合适的标签(Label)
|
|
276
|
+
- [ ] 关联了相关 Issue
|
|
277
|
+
- [ ] 没有合并冲突
|
|
278
|
+
- [ ] 通过了 CI/CD 流水线(如有)
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## Git 工作流规范
|
|
282
|
+
|
|
283
|
+
### 分支命名规范
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
feature/[feature-name] # 新功能
|
|
287
|
+
fix/[bug-name] # Bug 修复
|
|
288
|
+
refactor/[refactor-name] # 重构
|
|
289
|
+
hotfix/[hotfix-name] # 紧急修复
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### 分支管理策略
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
# 从 main 创建特性分支
|
|
296
|
+
git checkout main
|
|
297
|
+
git pull origin main
|
|
298
|
+
git checkout -b feature/user-login
|
|
299
|
+
|
|
300
|
+
# 定期同步 main 分支
|
|
301
|
+
git checkout main
|
|
302
|
+
git pull origin main
|
|
303
|
+
git checkout feature/user-login
|
|
304
|
+
git merge main
|
|
305
|
+
|
|
306
|
+
# 或使用 rebase(保持提交历史线性)
|
|
307
|
+
git rebase main
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### 解决合并冲突
|
|
311
|
+
|
|
312
|
+
```bash
|
|
313
|
+
# 1. 拉取最新代码
|
|
314
|
+
git checkout main
|
|
315
|
+
git pull origin main
|
|
316
|
+
|
|
317
|
+
# 2. 合并到特性分支
|
|
318
|
+
git checkout feature/user-login
|
|
319
|
+
git merge main
|
|
320
|
+
|
|
321
|
+
# 3. 解决冲突
|
|
322
|
+
# 手动编辑冲突文件,解决冲突标记
|
|
323
|
+
# <<<<<<< HEAD
|
|
324
|
+
# =======
|
|
325
|
+
# >>>>>>> main
|
|
326
|
+
|
|
327
|
+
# 4. 标记冲突已解决
|
|
328
|
+
git add .
|
|
329
|
+
git commit -m "chore: resolve merge conflicts with main"
|
|
330
|
+
|
|
331
|
+
# 5. 推送
|
|
332
|
+
git push origin feature/user-login
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
## 常用 Git 操作
|
|
336
|
+
|
|
337
|
+
### 查看变更
|
|
338
|
+
```bash
|
|
339
|
+
# 查看工作区状态
|
|
340
|
+
git status
|
|
341
|
+
|
|
342
|
+
# 查看变更内容
|
|
343
|
+
git diff
|
|
344
|
+
|
|
345
|
+
# 查看已暂存的变更
|
|
346
|
+
git diff --cached
|
|
347
|
+
|
|
348
|
+
# 查看提交历史
|
|
349
|
+
git log --oneline --graph --all
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
### 撤销操作
|
|
353
|
+
```bash
|
|
354
|
+
# 撤销工作区的修改
|
|
355
|
+
git checkout -- file.go
|
|
356
|
+
|
|
357
|
+
# 撤销已暂存的修改
|
|
358
|
+
git reset HEAD file.go
|
|
359
|
+
|
|
360
|
+
# 修改最后一次提交消息
|
|
361
|
+
git commit --amend -m "new message"
|
|
362
|
+
|
|
363
|
+
# 撤销最后一次提交(保留变更)
|
|
364
|
+
git reset --soft HEAD^
|
|
365
|
+
|
|
366
|
+
# 撤销最后一次提交(丢弃变更)
|
|
367
|
+
git reset --hard HEAD^
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### 查看 MR 状态
|
|
371
|
+
```bash
|
|
372
|
+
# 列出所有 MR
|
|
373
|
+
glab mr list
|
|
374
|
+
|
|
375
|
+
# 查看 MR 详情
|
|
376
|
+
glab mr view <mr-number>
|
|
377
|
+
|
|
378
|
+
# 查看 MR 状态
|
|
379
|
+
glab mr status
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
## 钉钉通知集成
|
|
383
|
+
|
|
384
|
+
### 预检测失败通知
|
|
385
|
+
|
|
386
|
+
通知格式(JSON):
|
|
387
|
+
```json
|
|
388
|
+
{
|
|
389
|
+
"msgtype": "markdown",
|
|
390
|
+
"markdown": {
|
|
391
|
+
"title": "SDD 工作流失败",
|
|
392
|
+
"text": "❌ **SDD 预检测失败**\n\n- **工作流**: user-login\n- **失败阶段**: Git Engineer - 预检测\n- **失败项**:\n - Lint 检查失败:5 个错误\n - 单元测试失败:2/15 测试用例\n- **建议操作**: 返回对应的 Engineer 修复\n\n🕐 **时间**: 2026-01-06 16:00:00"
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
### MR 创建成功通知(可选)
|
|
398
|
+
|
|
399
|
+
```json
|
|
400
|
+
{
|
|
401
|
+
"msgtype": "markdown",
|
|
402
|
+
"markdown": {
|
|
403
|
+
"title": "SDD 工作流完成",
|
|
404
|
+
"text": "✅ **SDD MR 已创建**\n\n- **工作流**: user-login\n- **MR 标题**: feat(auth): Add user login functionality\n- **MR 链接**: https://git.in.chaitin.net/yusheng.wang/project/-/merge_requests/1\n- **审查人**: @reviewer1\n\n🕐 **时间**: 2026-01-06 16:30:00"
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
**注意**: 消息必须包含 "SDD" 关键字。
|
|
410
|
+
|
|
411
|
+
## 与其他 Skills 的协作
|
|
412
|
+
|
|
413
|
+
1. **上游**: 接收 Code Reviewer 审查通过的代码
|
|
414
|
+
2. **下游**:
|
|
415
|
+
- 预检测通过 + MR 创建成功 → 工作流完成
|
|
416
|
+
- 预检测失败 → 返回对应的 Engineer 修复
|
|
417
|
+
3. **并行**: 无
|
|
418
|
+
|
|
419
|
+
## 在 Pre-Execution Review 中的角色
|
|
420
|
+
|
|
421
|
+
提供 Git 和 CI/CD 视角评估:
|
|
422
|
+
- 分支策略是否合理
|
|
423
|
+
- 是否与现有 CI/CD 流程兼容
|
|
424
|
+
- 预检测步骤是否完整
|
|
425
|
+
- 潜在的合并冲突风险
|
|
426
|
+
- MR 审查流程是否规范
|
|
427
|
+
|
|
428
|
+
## 示例对话
|
|
429
|
+
|
|
430
|
+
```
|
|
431
|
+
我(Git Engineer):
|
|
432
|
+
|
|
433
|
+
代码审查已通过,开始预检测...
|
|
434
|
+
|
|
435
|
+
📋 执行后端预检测:
|
|
436
|
+
✅ 代码格式化:通过
|
|
437
|
+
✅ Lint 检查:通过
|
|
438
|
+
✅ 编译检查:通过
|
|
439
|
+
✅ 单元测试:12/12 通过
|
|
440
|
+
✅ 覆盖率:92% (>= 90%)
|
|
441
|
+
|
|
442
|
+
📋 执行前端预检测:
|
|
443
|
+
✅ 代码格式化:通过
|
|
444
|
+
✅ Lint 检查:通过
|
|
445
|
+
✅ 类型检查:通过
|
|
446
|
+
✅ 编译检查:通过
|
|
447
|
+
✅ 单元测试:8/8 通过
|
|
448
|
+
✅ 覆盖率:75% (>= 70%)
|
|
449
|
+
|
|
450
|
+
✅ 所有预检测通过!
|
|
451
|
+
|
|
452
|
+
开始提交代码...
|
|
453
|
+
|
|
454
|
+
已创建提交:
|
|
455
|
+
```
|
|
456
|
+
feat(auth): add user login with JWT authentication
|
|
457
|
+
|
|
458
|
+
Implement user login functionality with following features:
|
|
459
|
+
- Email and password validation
|
|
460
|
+
- JWT token generation
|
|
461
|
+
- Redis session storage
|
|
462
|
+
- Password encryption with bcrypt
|
|
463
|
+
|
|
464
|
+
Related to: #123
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
已推送到远程:feature/user-login
|
|
468
|
+
|
|
469
|
+
创建 GitLab Merge Request...
|
|
470
|
+
|
|
471
|
+
✅ MR 已创建成功!
|
|
472
|
+
|
|
473
|
+
MR 信息:
|
|
474
|
+
- 标题:feat(auth): Add user login functionality
|
|
475
|
+
- 链接:https://git.in.chaitin.net/yusheng.wang/project/-/merge_requests/1
|
|
476
|
+
- 源分支:feature/user-login
|
|
477
|
+
- 目标分支:main
|
|
478
|
+
- 审查人:@reviewer1
|
|
479
|
+
- 标签:feature, backend, frontend
|
|
480
|
+
|
|
481
|
+
📋 MR 描述包含:
|
|
482
|
+
- 功能概述
|
|
483
|
+
- 实现内容清单
|
|
484
|
+
- 测试结果(后端 92%, 前端 75%)
|
|
485
|
+
- 验收标准(5/5 满足)
|
|
486
|
+
- 审查要点
|
|
487
|
+
|
|
488
|
+
✅ SDD 工作流完成!
|
|
489
|
+
|
|
490
|
+
下一步:等待审查人批准 MR
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
## CI/CD 集成(可选)
|
|
494
|
+
|
|
495
|
+
如果项目配置了 GitLab CI,可在 `.gitlab-ci.yml` 中定义流水线:
|
|
496
|
+
|
|
497
|
+
```yaml
|
|
498
|
+
# .gitlab-ci.yml
|
|
499
|
+
stages:
|
|
500
|
+
- lint
|
|
501
|
+
- build
|
|
502
|
+
- test
|
|
503
|
+
|
|
504
|
+
# 后端 Lint
|
|
505
|
+
backend-lint:
|
|
506
|
+
stage: lint
|
|
507
|
+
script:
|
|
508
|
+
- cd backend
|
|
509
|
+
- golangci-lint run
|
|
510
|
+
|
|
511
|
+
# 前端 Lint
|
|
512
|
+
frontend-lint:
|
|
513
|
+
stage: lint
|
|
514
|
+
script:
|
|
515
|
+
- cd frontend
|
|
516
|
+
- npm install
|
|
517
|
+
- npm run lint
|
|
518
|
+
|
|
519
|
+
# 后端构建
|
|
520
|
+
backend-build:
|
|
521
|
+
stage: build
|
|
522
|
+
script:
|
|
523
|
+
- cd backend
|
|
524
|
+
- go build ./...
|
|
525
|
+
|
|
526
|
+
# 前端构建
|
|
527
|
+
frontend-build:
|
|
528
|
+
stage: build
|
|
529
|
+
script:
|
|
530
|
+
- cd frontend
|
|
531
|
+
- npm install
|
|
532
|
+
- npm run build
|
|
533
|
+
|
|
534
|
+
# 后端测试
|
|
535
|
+
backend-test:
|
|
536
|
+
stage: test
|
|
537
|
+
script:
|
|
538
|
+
- cd backend
|
|
539
|
+
- go test ./... -coverprofile=coverage.out
|
|
540
|
+
- go tool cover -func=coverage.out | grep total
|
|
541
|
+
|
|
542
|
+
# 前端测试
|
|
543
|
+
frontend-test:
|
|
544
|
+
stage: test
|
|
545
|
+
script:
|
|
546
|
+
- cd frontend
|
|
547
|
+
- npm install
|
|
548
|
+
- npm run test:coverage
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
## 参考资源
|
|
552
|
+
|
|
553
|
+
- [Conventional Commits 规范](https://www.conventionalcommits.org/)
|
|
554
|
+
- [GitLab Flow](https://docs.gitlab.com/ee/topics/gitlab_flow.html)
|
|
555
|
+
- [glab CLI 文档](https://gitlab.com/gitlab-org/cli)
|
|
556
|
+
- [Git 最佳实践](https://git-scm.com/book/zh/v2)
|