Files
Edu/.github/workflows/ci-ts.yml
SpecialX c31b3ddeba ci(infra): workflow 参照 CICD 参考项目重构
- 所有需要 docker 的 job 改用 container: dockerreg.eazygame.cn/node-with-docker:22

- ci-go.yml: quality 阶段用 golang:1.22-alpine,docker-build 阶段切到 node-with-docker:22

- ci-ts.yml/docker.yml/deploy.yml: 全部加 container 配置

- 移除 setup-node/setup-go action(容器内已有 node/go 或手动安装)

- 不配置 npm 代理(runner 已全局代理)
2026-07-08 16:12:07 +08:00

99 lines
2.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: CI TypeScript
# 参考实现E:\Desktop\CICD\.gitea\workflows\ci.yml
# 关键配置container: dockerreg.eazygame.cn/node-with-docker:22带 docker 的 node 22
# 详见 docs/standards/cicd-runbook.md §10、project_rules §15.7
on:
push:
branches: [main]
paths:
- 'services/classes/**'
- 'apps/**'
- 'packages/**'
- 'scripts/**'
- 'package.json'
- 'pnpm-workspace.yaml'
- 'tsconfig.base.json'
- '.github/workflows/ci-ts.yml'
pull_request:
branches: [main]
paths:
- 'services/classes/**'
- 'apps/**'
- 'packages/**'
- 'scripts/**'
- 'package.json'
- 'pnpm-workspace.yaml'
- 'tsconfig.base.json'
- '.github/workflows/ci-ts.yml'
env:
SKIP_ENV_VALIDATION: '1'
NEXT_TELEMETRY_DISABLED: '1'
jobs:
quality:
runs-on: ubuntu-latest
container: dockerreg.eazygame.cn/node-with-docker:22
steps:
- uses: actions/checkout@v4
- name: Install pnpm
run: npm install -g pnpm@9
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm -r run lint
continue-on-error: true # P1: ESLint 9 flat config 迁移未完成
- name: Typecheck
run: pnpm -r run typecheck
- name: Test
run: pnpm -r run test
continue-on-error: true # P1: 部分服务无 test 脚本
- name: Build
run: pnpm -r run build
arch-scan:
runs-on: ubuntu-latest
container: dockerreg.eazygame.cn/node-with-docker:22
needs: quality
steps:
- uses: actions/checkout@v4
- name: Install pnpm
run: npm install -g pnpm@9
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: arch:scan
run: pnpm run arch:scan
- name: Verify arch.db committed
run: |
if git diff --quiet -- scripts/arch-scan/arch.db; then
echo "arch.db up to date"
else
echo "::warning::arch.db 未同步,请运行 pnpm run arch:scan 并提交"
fi
docker-build:
runs-on: ubuntu-latest
container: dockerreg.eazygame.cn/node-with-docker:22
needs: quality
strategy:
matrix:
service:
- { name: classes, dockerfile: services/classes/Dockerfile, context: . }
- { name: teacher-portal, dockerfile: apps/teacher-portal/Dockerfile, context: . }
steps:
- uses: actions/checkout@v4
- name: Build ${{ matrix.service.name }}
run: |
docker build \
-t edu/${{ matrix.service.name }}:ci \
-f ${{ matrix.service.dockerfile }} \
${{ matrix.service.context }}