Skip to content

Commit 65f5330

Browse files
committed
优化 CI:使用 find 递归检查 Python 语法
为相关步骤添加 shell: bash,合并并替换原有多条 python -m py_compile 命令,确保递归检查 src 和 tests 目录下的所有 .py 文件
1 parent e3952cf commit 65f5330

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,13 @@ jobs:
4141
pip install -r requirements.txt
4242
4343
- name: 检查代码语法
44+
shell: bash
4445
run: |
45-
python -m py_compile src/*.py
46-
python -m py_compile src/platform/*.py
47-
python -m py_compile src/platform/*/ *.py
48-
python -m py_compile src/anti_ban/*.py
46+
find src -name "*.py" -exec python -m py_compile {} \;
4947
5048
- name: 检查测试语法
51-
run: python -m py_compile tests/*.py
49+
shell: bash
50+
run: find tests -name "*.py" -exec python -m py_compile {} \;
5251

5352
- name: 运行测试
5453
run: |

0 commit comments

Comments
 (0)