Skip to content

Commit ce98e10

Browse files
committed
添加GitHub Actions CI/CD配置和模板
1 parent ce6840b commit ce98e10

File tree

5 files changed

+412
-0
lines changed

5 files changed

+412
-0
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: 🐛 Bug Report
2+
description: 报告一个bug来帮助我们改进
3+
title: "[BUG] "
4+
labels: ["bug", "needs-triage"]
5+
assignees: []
6+
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: |
11+
感谢您使用 MoonProgress!请详细描述遇到的问题,这将帮助我们更快地解决bug。
12+
13+
- type: textarea
14+
id: description
15+
attributes:
16+
label: 🐛 Bug描述
17+
description: 请清楚简洁地描述这个bug
18+
placeholder: 描述您遇到的问题...
19+
validations:
20+
required: true
21+
22+
- type: textarea
23+
id: reproduction
24+
attributes:
25+
label: 🔄 复现步骤
26+
description: 提供复现bug的步骤
27+
placeholder: |
28+
1. 执行 '...'
29+
2. 点击 '....'
30+
3. 滚动到 '....'
31+
4. 看到错误
32+
validations:
33+
required: true
34+
35+
- type: textarea
36+
id: expected
37+
attributes:
38+
label: ✅ 期望行为
39+
description: 描述您期望发生的行为
40+
validations:
41+
required: true
42+
43+
- type: textarea
44+
id: actual
45+
attributes:
46+
label: ❌ 实际行为
47+
description: 描述实际发生的行为
48+
validations:
49+
required: true
50+
51+
- type: textarea
52+
id: environment
53+
attributes:
54+
label: 🌍 环境信息
55+
description: 请提供相关的环境信息
56+
value: |
57+
- OS: [e.g. macOS 14.0, Ubuntu 22.04, Windows 11]
58+
- MoonBit版本: [e.g. 0.1.20231201]
59+
- MoonProgress版本: [e.g. v1.0.0]
60+
- 终端: [e.g. Terminal.app, iTerm2, CMD, PowerShell]
61+
validations:
62+
required: true
63+
64+
- type: textarea
65+
id: additional
66+
attributes:
67+
label: 📝 额外信息
68+
description: 添加任何其他与问题相关的信息、截图等
69+
70+
- type: checkboxes
71+
id: checklist
72+
attributes:
73+
label: ✅ 检查清单
74+
description: 请确认以下事项
75+
options:
76+
- label: 我已经搜索了现有的issues,确认这不是重复问题
77+
required: true
78+
- label: 我已经阅读了文档和README
79+
required: true
80+
- label: 我提供了完整的复现步骤
81+
required: true
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: ✨ Feature Request
2+
description: 建议一个新功能或改进
3+
title: "[FEATURE] "
4+
labels: ["enhancement", "feature-request"]
5+
assignees: []
6+
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: |
11+
感谢您对 MoonProgress 的关注!我们很乐意听到您的想法和建议。
12+
13+
- type: textarea
14+
id: problem
15+
attributes:
16+
label: 🤔 问题描述
17+
description: 这个功能请求是否与某个问题相关?请描述一下。
18+
placeholder: 我在使用时遇到了困扰,因为...
19+
validations:
20+
required: true
21+
22+
- type: textarea
23+
id: solution
24+
attributes:
25+
label: 💡 期望的解决方案
26+
description: 描述您希望看到的功能
27+
placeholder: 我希望能够...
28+
validations:
29+
required: true
30+
31+
- type: textarea
32+
id: alternatives
33+
attributes:
34+
label: 🔄 备选方案
35+
description: 描述您考虑过的其他解决方案或功能
36+
placeholder: 我也考虑过...
37+
38+
- type: dropdown
39+
id: priority
40+
attributes:
41+
label: 📊 优先级
42+
description: 这个功能对您有多重要?
43+
options:
44+
- 低 - 可有可无的改进
45+
- 中 - 会很有用的功能
46+
- 高 - 非常需要的功能
47+
- 紧急 - 阻碍使用的关键功能
48+
validations:
49+
required: true
50+
51+
- type: dropdown
52+
id: category
53+
attributes:
54+
label: 🏷️ 功能类别
55+
description: 这个功能属于哪个类别?
56+
options:
57+
- 📊 进度条样式
58+
- ⚙️ API改进
59+
- 🎨 UI/UX改进
60+
- 📝 文档改进
61+
- 🧪 测试相关
62+
- 🚀 性能优化
63+
- 🔧 开发体验
64+
- 🌍 国际化
65+
- 🔌 集成功能
66+
- 📦 打包/分发
67+
- 其他
68+
validations:
69+
required: true
70+
71+
- type: textarea
72+
id: implementation
73+
attributes:
74+
label: 🛠️ 实现想法
75+
description: 如果您有具体的实现想法,请分享
76+
placeholder: 可以通过以下方式实现...
77+
78+
- type: textarea
79+
id: examples
80+
attributes:
81+
label: 📋 使用示例
82+
description: 提供一些代码示例展示期望的API或用法
83+
placeholder: |
84+
```moonbit
85+
// 期望的使用方式
86+
let progress = ProgressBar::new()
87+
progress.set_style("新样式")
88+
```
89+
90+
- type: checkboxes
91+
id: checklist
92+
attributes:
93+
label: ✅ 检查清单
94+
description: 请确认以下事项
95+
options:
96+
- label: 我已经搜索了现有的issues,确认这不是重复请求
97+
required: true
98+
- label: 我已经阅读了文档,确认当前没有这个功能
99+
required: true
100+
- label: 这个功能与MoonProgress的目标相符
101+
required: true

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# 🚀 Pull Request
2+
3+
## 📋 变更描述
4+
<!-- 简要描述此PR的主要变更 -->
5+
6+
## 🎯 变更类型
7+
<!-- 请选择此PR的类型 -->
8+
- [ ] 🐛 Bug修复
9+
- [ ] ✨ 新功能
10+
- [ ] 💥 破坏性变更
11+
- [ ] 📝 文档更新
12+
- [ ] 🎨 代码风格/格式化
13+
- [ ] ♻️ 重构
14+
- [ ] ⚡ 性能优化
15+
- [ ] ✅ 测试相关
16+
- [ ] 🔧 构建/CI相关
17+
- [ ] 📦 依赖更新
18+
19+
## 🔗 相关Issues
20+
<!-- 链接到相关的issues,例如: Fixes #123, Resolves #456 -->
21+
22+
## 📸 截图/演示
23+
<!-- 如果有UI变更,请提供截图或GIF -->
24+
25+
## 🧪 测试
26+
<!-- 描述您如何测试了这些变更 -->
27+
- [ ] 我已经测试了我的代码
28+
- [ ] 我已经运行了现有的测试套件
29+
- [ ] 我已经添加了新的测试用例(如适用)
30+
31+
### 测试步骤
32+
1.
33+
2.
34+
3.
35+
36+
## 📋 检查清单
37+
<!-- 请确认以下项目 -->
38+
- [ ] 我已经阅读了贡献指南
39+
- [ ] 我的代码遵循了项目的代码风格
40+
- [ ] 我已经运行了 `moon fmt` 格式化代码
41+
- [ ] 我已经运行了 `moon test` 确保所有测试通过
42+
- [ ] 我已经更新了相关文档(如适用)
43+
- [ ] 我的变更不会引入新的警告
44+
- [ ] 所有新的和现有的测试都通过了
45+
46+
## 💭 额外说明
47+
<!-- 任何额外的信息或需要注意的事项 -->
48+
49+
## 📚 文档变更
50+
<!-- 如果需要更新文档,请说明 -->
51+
- [ ] README.md
52+
- [ ] API文档
53+
- [ ] 示例代码
54+
- [ ] 其他: ___________
55+
56+
---
57+
58+
感谢您的贡献!🙏 我们会尽快审查您的PR。

.github/workflows/ci.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
name: 🧪 Test & Build
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: 📦 Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: 🌙 Setup MoonBit
19+
uses: moonbitlang/setup-moonbit@v1
20+
with:
21+
version: 'latest'
22+
23+
- name: 📋 Check moon version
24+
run: |
25+
moon version
26+
moon --help
27+
28+
- name: 🔧 Build project
29+
run: |
30+
moon build
31+
32+
- name: 🧪 Run tests
33+
run: |
34+
moon test
35+
36+
- name: 📊 Run examples
37+
run: |
38+
cd examples
39+
moon run cli_demo
40+
41+
lint:
42+
name: 🔍 Code Quality
43+
runs-on: ubuntu-latest
44+
45+
steps:
46+
- name: 📦 Checkout code
47+
uses: actions/checkout@v4
48+
49+
- name: 🌙 Setup MoonBit
50+
uses: moonbitlang/setup-moonbit@v1
51+
with:
52+
version: 'latest'
53+
54+
- name: 🔍 Check code format
55+
run: |
56+
moon fmt --check
57+
58+
- name: 📝 Lint code
59+
run: |
60+
moon check
61+
62+
security:
63+
name: 🔒 Security Scan
64+
runs-on: ubuntu-latest
65+
66+
steps:
67+
- name: 📦 Checkout code
68+
uses: actions/checkout@v4
69+
70+
- name: 🔒 Run security audit
71+
run: |
72+
# 检查敏感信息泄露
73+
if grep -r "password\|secret\|key\|token" . --exclude-dir=.git --exclude-dir=.github; then
74+
echo "⚠️ 发现可能的敏感信息"
75+
exit 1
76+
else
77+
echo "✅ 安全检查通过"
78+
fi

0 commit comments

Comments
 (0)