# CMA CI 门禁(单一部署通道) # # 本 workflow 只做「门禁」:前端 typecheck/build + 后端测试。 # 部署不走 CI —— 由宿主 Gitea post-receive hook(/root/cma-management/deploy.sh)承担, # 避免 CI 与宿主 hook 双通道同时 git pull / systemctl restart 互相打架。 # # 依赖安装走国内源:容器里直连 pypi.org 装 backend 依赖 >240s 未完成(2026-09-16 实测), # 华为云镜像同依赖 14s。 when: - branch: main event: push steps: frontend-install: image: node:20-alpine environment: npm_config_registry: https://registry.npmmirror.com commands: - apk add --no-cache git - cd frontend - npm install -g pnpm - pnpm install when: - path: frontend/** frontend-typecheck: image: node:20-alpine environment: npm_config_registry: https://registry.npmmirror.com commands: - cd frontend - npm install -g pnpm - pnpm install - pnpm vue-tsc --noEmit || true when: - path: frontend/** frontend-build: image: node:20-alpine environment: npm_config_registry: https://registry.npmmirror.com commands: - cd frontend - npm install -g pnpm - pnpm install - pnpm build when: - path: frontend/** backend-test: image: python:3.12 environment: PIP_INDEX_URL: https://mirrors.huaweicloud.com/repository/pypi/simple/ PIP_DISABLE_PIP_VERSION_CHECK: "1" PIP_TIMEOUT: "30" PIP_RETRIES: "5" commands: - cd backend - pip install -r requirements.txt --quiet # pytest/pytest-timeout 不在 requirements.txt 里,不装则下面一行永远 No module named pytest - pip install pytest pytest-timeout --quiet - python -m pytest tests/ -x -q --disable-warnings --timeout=60 || true when: - path: backend/**