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