ci: run real quality gates
This commit is contained in:
@@ -61,16 +61,15 @@ jobs:
|
||||
|
||||
- name: Run code quality checks
|
||||
run: |
|
||||
python -m black --version
|
||||
python -m isort --version-number
|
||||
python -m flake8 --version
|
||||
bandit --version
|
||||
echo "✅ Code quality environment is ready"
|
||||
python -m compileall -q apps packages tests
|
||||
python -m black --check apps packages tests
|
||||
python -m isort --check-only apps packages tests
|
||||
python -m flake8 apps packages tests --count --statistics
|
||||
bandit -r apps packages -q
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
pytest --version
|
||||
echo "✅ Test environment is ready"
|
||||
python -m pytest tests -q
|
||||
|
||||
- name: Build summary
|
||||
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main'
|
||||
|
||||
@@ -61,16 +61,15 @@ jobs:
|
||||
|
||||
- name: Run code quality checks
|
||||
run: |
|
||||
python -m black --version
|
||||
python -m isort --version-number
|
||||
python -m flake8 --version
|
||||
bandit --version
|
||||
echo "✅ Code quality environment is ready"
|
||||
python -m compileall -q apps packages tests
|
||||
python -m black --check apps packages tests
|
||||
python -m isort --check-only apps packages tests
|
||||
python -m flake8 apps packages tests --count --statistics
|
||||
bandit -r apps packages -q
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
pytest --version
|
||||
echo "✅ Test environment is ready"
|
||||
python -m pytest tests -q
|
||||
|
||||
- name: Build summary
|
||||
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main'
|
||||
|
||||
@@ -119,6 +119,24 @@
|
||||
- 误导入时立即抛出清晰错误,而不是深层 ImportError。
|
||||
- 后续只能在重建 DI composition root 后重新启用。
|
||||
|
||||
### 7. P1:CI 质量门禁只打印版本,不执行检查
|
||||
|
||||
**涉及文件**:`.gitea/workflows/ci-cd.yml`、`.github/workflows/ci-cd.yml`
|
||||
|
||||
**问题**:
|
||||
- CI 安装/验证工具版本后直接成功。
|
||||
- `black/isort/flake8/bandit/pytest` 没有实际检查代码。
|
||||
- develop/main 可能在红线问题未暴露时继续部署。
|
||||
|
||||
**根因**:
|
||||
- 早期为了验证 CI 环境可用,留下了占位命令。
|
||||
- 后续没有升级为真实质量门禁。
|
||||
|
||||
**修复**:
|
||||
- CI 改为执行 `compileall`、`black --check`、`isort --check-only`、`flake8`、`bandit`。
|
||||
- 测试步骤改为 `python -m pytest tests -q`。
|
||||
- Gitea 与 GitHub workflow 保持一致,避免 CI 双轨漂移。
|
||||
|
||||
## 三、已补充测试
|
||||
|
||||
### 新增
|
||||
|
||||
Reference in New Issue
Block a user