Skip to content

Commit 439654e

Browse files
author
zhanghe5
committed
ci: 添加GitHub工作流和模板
- 添加Python应用测试工作流 - 添加Bug报告和功能请求的Issue模板 - 添加Pull Request模板 - 配置自动化CI/CD流程
1 parent 429f7a3 commit 439654e

File tree

4 files changed

+120
-0
lines changed

4 files changed

+120
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug报告
3+
about: 创建一个报告来帮助我们改进
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**描述Bug**
11+
清晰简洁地描述这个bug是什么。
12+
13+
**重现步骤**
14+
重现这个行为的步骤:
15+
1. 进入 '...'
16+
2. 点击 '....'
17+
3. 滚动到 '....'
18+
4. 看到错误
19+
20+
**预期行为**
21+
清晰简洁地描述您期望发生什么。
22+
23+
**截图**
24+
如果适用,添加截图来帮助解释您的问题。
25+
26+
**环境信息:**
27+
- 操作系统: [例如 macOS, Windows, Linux]
28+
- Python版本: [例如 3.9.0]
29+
- 应用版本: [例如 GUI, Web, CLI]
30+
31+
**附加内容**
32+
在此处添加关于该问题的任何其他内容。
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: 功能请求
3+
about: 为这个项目建议一个想法
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**您的功能请求是否与问题相关?请描述。**
11+
清晰简洁地描述问题是什么。例如:当我尝试...时总是很烦恼
12+
13+
**描述您想要的解决方案**
14+
清晰简洁地描述您希望发生什么。
15+
16+
**描述您考虑过的替代方案**
17+
清晰简洁地描述您考虑过的任何替代解决方案或功能。
18+
19+
**附加内容**
20+
在此处添加关于功能请求的任何其他内容或截图。

.github/pull_request_template.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## 更改描述
2+
3+
请简要描述您的更改内容。
4+
5+
## 更改类型
6+
7+
请删除不相关的选项:
8+
9+
- [ ] Bug修复 (不破坏现有功能的更改)
10+
- [ ] 新功能 (添加功能的不破坏性更改)
11+
- [ ] 破坏性更改 (会导致现有功能无法正常工作的修复或功能)
12+
- [ ] 文档更新
13+
14+
## 测试
15+
16+
请描述您为验证更改而运行的测试:
17+
18+
- [ ] 测试A
19+
- [ ] 测试B
20+
21+
## 检查清单
22+
23+
- [ ] 我的代码遵循此项目的代码规范
24+
- [ ] 我已进行自我审查
25+
- [ ] 我已对我的代码进行了注释,特别是在难以理解的地方
26+
- [ ] 我已相应地更改了文档
27+
- [ ] 我的更改不会产生新的警告
28+
- [ ] 新的和现有的单元测试都通过了我的更改

.github/workflows/test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Python 应用测试
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: [3.8, 3.9, '3.10', '3.11']
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: 设置 Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v3
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: 安装依赖
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -r requirements.txt
28+
29+
- name: 语法检查
30+
run: |
31+
python -m py_compile daily_planner.py
32+
python -m py_compile daily_planner_cli.py
33+
python -m py_compile web_server.py
34+
python -m py_compile launcher.py
35+
36+
- name: 运行基本测试
37+
run: |
38+
python -c "import daily_planner; print('GUI模块导入成功')"
39+
python -c "import daily_planner_cli; print('CLI模块导入成功')"
40+
python -c "import web_server; print('Web服务器模块导入成功')"

0 commit comments

Comments
 (0)