From 380195fffca633ec4929a53826df5e84cd3bd0a8 Mon Sep 17 00:00:00 2001 From: liuyun Date: Sun, 11 Oct 2026 17:02:08 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E8=A1=A5=20CI=20+=20docker-compose=20+?= =?UTF-8?q?=20=E5=89=8D=E5=90=8E=E7=AB=AF=20Dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 --- .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 19 ++++++++++++++++ docs/audit-checklist.md | 4 ++-- sources/sysmgr-nest | 2 +- 4 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 docker-compose.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3b82399 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: CI + +on: + push: + pull_request: + +jobs: + backend: + runs-on: ubuntu-latest + defaults: + run: + working-directory: sources/sysmgr-nest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: pnpm/action-setup@v4 + with: + version: 12 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + cache-dependency-path: sources/sysmgr-nest/pnpm-lock.yaml + - run: pnpm install --frozen-lockfile + - run: pnpm build + - run: pnpm test + + frontend: + runs-on: ubuntu-latest + defaults: + run: + working-directory: sources/sysmgr-admin + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: pnpm/action-setup@v4 + with: + version: 12 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + cache-dependency-path: sources/sysmgr-admin/pnpm-lock.yaml + - run: pnpm install --frozen-lockfile + - run: pnpm type-check + - run: pnpm build-only diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7b19ffc --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,19 @@ +services: + mysql: + image: mysql:8.0 + environment: + MYSQL_ROOT_PASSWORD: Mysql@123 + MYSQL_DATABASE: sysmgr + ports: + - "3306:3306" + volumes: + - mysql-data:/var/lib/mysql + command: --default-authentication-plugin=mysql_native_password + + redis: + image: redis:7 + ports: + - "6379:6379" + +volumes: + mysql-data: diff --git a/docs/audit-checklist.md b/docs/audit-checklist.md index d698ad3..0269ee8 100644 --- a/docs/audit-checklist.md +++ b/docs/audit-checklist.md @@ -49,7 +49,7 @@ ## P3 工程化契约 -- [ ] **H12** e2e 必然失败 + 无业务测试 —— 方案:修 e2e + 补核心链路用例 +- [x] **H12** e2e 必然失败 + 无业务测试 —— ✔ 已完成:e2e 改为登录链路(成功/失败),补 mask/data-scope 单测 - [x] **M2** 时间字段 ISO vs Unix 毫秒 —— ✔ 已完成:API 层统一 Unix 毫秒(TransformInterceptor 递归转换 + 前端类型 number) - [x] **M16** vite `olldownOptions` 拼写错误 —— ✔ 已完成:改 `rolldownOptions` - [x] **M19** 前端 .env/.env.dev 入库 + .env.example 带像真密码 —— ✔ 已完成:gitignore .env + .env.example 模板 + untrack @@ -59,5 +59,5 @@ - [x] **L4** README 克隆命令与子模块风格不一致 —— ✔ 已完成:统一 ssh:// 端口 - [x] **L6** ty-crud 取消确认 rejection 未捕获 —— ✔ 已完成:catch 取消 - [x] **L9** @nestjs/mau 非常规依赖 —— ✔ 已完成:核实为 NestJS Mau 部署 CLI,已移除 + 删 deploy 脚本 -- [ ] **L10** 无 CI/Dockerfile/compose 部署编排 —— 方案:补 CI + 部署物料 +- [x] **L10** 无 CI/Dockerfile/compose 部署编排 —— ✔ 已完成:docker-compose(MySQL/Redis)+ CI(前后端 build/test)+ 前后端 Dockerfile - [ ] **新增** spec 覆盖补全 —— users/roles/orgs/tenants/configs 与前端多页无 spec 锚点。方案:补主 spec diff --git a/sources/sysmgr-nest b/sources/sysmgr-nest index ebc0797..6937f9e 160000 --- a/sources/sysmgr-nest +++ b/sources/sysmgr-nest @@ -1 +1 @@ -Subproject commit ebc07974248f3279f32c79cd3e1c95b1121f197a +Subproject commit 6937f9ece03ece26a0ba36e684dbe45ac9f098c1