mirror of
https://ghfast.top/https://github.com/aeroxw/easy_tdx_max.git
synced 2026-09-12 18:04:20 +08:00
fix(ci): ci.yml test/mypy job 先构建前端再 pip install
pyproject.toml 的 force-include 要求 web-ui/dist 存在,否则 pip install -e . 报 FileNotFoundError。ci.yml 的 test 和 mypy job 此前没有构建前端步骤, 导致全部 CI 失败。 修复:test(6 矩阵)和 mypy job 在 pip install 前加 setup-node + npm ci + npm run build。frontend job 本来就有,不变。 同时清理 pyproject.toml:恢复 force-include(之前误改成 build-hook 但 hatchling 自定义 hook 需要插件注册,过于复杂)。
This commit is contained in:
@@ -22,6 +22,17 @@ jobs:
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
# 前端 dist 被 pyproject.toml 的 force-include 引用,pip install -e .
|
||||
# 要求它存在。先构建前端(type-check + vite build)。
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "20"
|
||||
cache: "npm"
|
||||
cache-dependency-path: web-ui/package-lock.json
|
||||
- run: npm ci
|
||||
working-directory: web-ui
|
||||
- run: npm run build
|
||||
working-directory: web-ui
|
||||
- run: pip install -e ".[dev]"
|
||||
- run: pip install -r requirements-dev.txt
|
||||
- run: python -m pytest tests/unit/ -v --tb=short --cov src/easy_tdx --cov-fail-under=60
|
||||
@@ -35,6 +46,16 @@ jobs:
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.13"
|
||||
# 同 test job:force-include 要求 web-ui/dist 存在。
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "20"
|
||||
cache: "npm"
|
||||
cache-dependency-path: web-ui/package-lock.json
|
||||
- run: npm ci
|
||||
working-directory: web-ui
|
||||
- run: npm run build
|
||||
working-directory: web-ui
|
||||
- run: pip install -e ".[dev,web]"
|
||||
- run: mypy src/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user