refactor(*): 平台架构 - 拆分后端领域模块与画布前端组件并补充测试

This commit is contained in:
ddcat666
2026-09-30 10:01:39 +08:00
parent e0a2697c60
commit 7f5d87ef1a
186 changed files with 33727 additions and 29905 deletions

View File

@@ -48,9 +48,12 @@ jobs:
echo "build_time=$(git show -s --format=%cI HEAD)" >> "$GITHUB_OUTPUT"
echo "owner=${REPOSITORY_OWNER,,}" >> "$GITHUB_OUTPUT"
# 镜像构建与质量检查并行:构建只推送不可变的 sha-<commit> 标签,不会被部署使用;
# 可变标签(latest / 版本号)的推广在 publish 中进行,并且必须等待 checks 通过。
# 这样发布总耗时约为 max(检查, 构建) 而不是两者相加。
build:
name: Build ${{ matrix.image }} (${{ matrix.arch }})
needs: [checks, prepare]
needs: [prepare]
permissions:
contents: read
packages: write
@@ -135,7 +138,7 @@ jobs:
publish:
name: Publish ${{ matrix.image }} manifest
needs: [prepare, build]
needs: [checks, prepare, build]
runs-on: ubuntu-latest
permissions:
contents: read

View File

@@ -7,10 +7,18 @@ on:
permissions:
contents: read
# 同一个 PR 连续推送时取消旧的检查,只保留最新提交;被发布流程调用(workflow_call)时
# 每次运行使用独立分组,绝不互相取消,避免中间提交的镜像发布被跳过。
concurrency:
group: quality-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
backend:
name: Backend checks
runs-on: ubuntu-latest
# go test 自身有 20 分钟超时;这里兜底防止依赖服务卡死时占用 Runner 数小时。
timeout-minutes: 30
defaults:
run:
working-directory: backend
@@ -59,8 +67,9 @@ jobs:
shell: bash
run: |
set -o pipefail
# The app package takes roughly nine minutes on a local full run;
# leave margin for slower runners and dependency-backed integration tests.
# internal/app 约 1000 个用例串行执行,是后端检查的关键路径(本地约 2–3 分钟)。
# 此前每个用例构造 Service 时都会完整解压 85MB 官方插件包(约 4 秒/次,累计 7 分钟以上),
# 现已改为只读清单 + 进程内缓存;若该包耗时再次明显上涨,先查 newPluginRuntime。
go test -json -timeout=20m ./... | tee "$RUNNER_TEMP/go-tests.jsonl"
- name: Ensure dependency-backed tests were not skipped
shell: bash
@@ -104,6 +113,7 @@ jobs:
web:
name: Web checks
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
run:
working-directory: web