From 1a0985ffa51f6953049b54c68f104650a2803ff6 Mon Sep 17 00:00:00 2001 From: zhengwr Date: Thu, 25 Jun 2026 11:41:21 +0800 Subject: [PATCH] =?UTF-8?q?ci(P0=E2=91=A3):=20CI=20=E5=AD=A4=E5=84=BF?= =?UTF-8?q?=E8=BF=81=20Gitea=20Actions=20+=20JDK21=20+=20ci=20=E6=97=81?= =?UTF-8?q?=E8=B7=AF=20profile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit .github/workflows/ci.yml(GHA 语法在 Gitea 上孤儿+JDK17 写死)迁至 .gitea/workflows/ci.yml(JDK21)。ci.sh 起服务加 --spring.profiles.active=ci(配合 P0① fail-safe,否则健康检查 401/对拍免令牌失效)。 Co-Authored-By: Claude Opus 4.8 (1M context) --- {.github => .gitea}/workflows/ci.yml | 13 ++++++++++--- scripts/ci.sh | 4 ++++ 2 files changed, 14 insertions(+), 3 deletions(-) rename {.github => .gitea}/workflows/ci.yml (56%) diff --git a/.github/workflows/ci.yml b/.gitea/workflows/ci.yml similarity index 56% rename from .github/workflows/ci.yml rename to .gitea/workflows/ci.yml index 91d8939..1da0def 100644 --- a/.github/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -1,4 +1,11 @@ -# eip4-platform CI:编译+单测+ArchUnit+对拍冒烟(公司自建 Git 服务可换 Jenkins,步骤同 scripts/ci.sh) +# eip4-platform CI(Gitea Actions)。 +# +# P0 修复(2026-06-24 架构评审):原 .github/workflows/ci.yml 在 Gitea(git.latent.chat)上是孤儿 +# (GitHub Actions 不会跑),且 java-version 写死 17(项目 JDK21)。本文件迁到 Gitea 规范位置 +# .gitea/workflows/,JDK 升 21。 +# +# 前置条件:Gitea 实例需已启用 Actions 且注册了带 `ubuntu-latest` 标签的 act_runner; +# 否则本工作流不会被调度(纯文件存在不等于会跑)。详见仓库 Actions 设置。 name: ci on: push: @@ -23,9 +30,9 @@ jobs: - uses: actions/setup-java@v4 with: distribution: temurin - java-version: "17" + java-version: "21" cache: maven - - name: 编译+单测+对拍冒烟 + - name: 编译+单测(含 ArchUnit)+对拍冒烟 env: CI_PG_HOST: localhost CI_PG_PORT: "5433" diff --git a/scripts/ci.sh b/scripts/ci.sh index 89cada5..6a555bf 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -32,7 +32,11 @@ psql -h "$CI_PG_HOST" -p "$CI_PG_PORT" -U "$CI_PG_USER" -d "$CI_DB" -q \ JDBC="jdbc:postgresql://${CI_PG_HOST}:${CI_PG_PORT}/${CI_DB}" echo "==[3/4] 起服务(:${CI_PORT} → ${JDBC})==" +# profile=ci:对拍冒烟依赖免令牌 permitAll + asUser/roles 旁路(见 SecurityProfiles)。 +# P0 fail-safe 修复后默认严格链(无 profile=强制认证),故 CI 必须显式声明 ci profile, +# 否则健康检查 /api/entity/... 被拒 401、ParityCli 免令牌重放失效。 java -jar platform-app/target/platform-app-*.jar \ + --spring.profiles.active=ci \ --server.port="$CI_PORT" \ --spring.datasource.url="$JDBC" \ --spring.datasource.username="$CI_PG_USER" \