From 3f6e8187cff64b0969e6943197d8dc7f15c258a7 Mon Sep 17 00:00:00 2001 From: Lixi20 Date: Fri, 4 Sep 2026 14:52:55 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=96=B0=E5=A2=9E=20Gitea=20Actions?= =?UTF-8?q?=20CI=20=E9=97=A8=E7=A6=81=E5=B7=A5=E4=BD=9C=E6=B5=81=EF=BC=88?= =?UTF-8?q?=E5=AE=A1=E8=AE=A1=20M3=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - .gitea/workflows/ci.yml:push(dev)/PR 触发 ./mvnw -B clean test,与本地门禁同一命令 - 服务器侧启用前提(开启 Actions、注册带 Docker 的 act_runner)已写入文件头注释;未启用时本文件无副作用 Co-Authored-By: Claude Fable 5 --- .gitea/workflows/ci.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .gitea/workflows/ci.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..d95e151 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,31 @@ +# Gitea Actions 门禁:与 docs/development/git-workflow.md 的本地门禁完全同一条命令。 +# +# 启用前提(服务器侧,一次性): +# 1. Gitea ≥ 1.19 且管理端开启 Actions(app.ini: [actions] ENABLED=true, +# 仓库 Settings → Actions 启用)。 +# 2. 注册一个 act_runner,且 runner 所在主机具备: +# - Docker(Testcontainers 需要,跑 postgres:18 一次性容器) +# - 标签 ubuntu-latest 映射到含 bash/git 的镜像,或 host 模式执行 +# 3. 若 runner 无法访问 github.com 拉取 actions/*,可在 runner 配置 +# [actions].DEFAULT_ACTIONS_URL 指向镜像源,或将下方 setup-java 步骤 +# 替换为直接使用预装 JDK 17 的 runner 镜像并删除该步骤。 +# +# 未启用 Actions 时本文件无副作用。 +name: CI + +on: + push: + branches: [dev] + pull_request: + +jobs: + backend-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '17' + # 与本地门禁同一命令;BUILD SUCCESS 且 0 失败方可合入(git-workflow.md) + - run: ./mvnw -B clean test