diff --git a/.woodpecker/dev-image.yml b/.woodpecker/dev-image.yml index 0485a00..bca21cd 100644 --- a/.woodpecker/dev-image.yml +++ b/.woodpecker/dev-image.yml @@ -67,3 +67,18 @@ steps: commands: - bash ci/build-dev-image.sh probe depends_on: [] + + # 慢的端到端测试:等三个镜像都构建、推送完再跑,不和 NativeAOT 编译抢内存(同时跑过一次,Backend 的 AOT 编译被 OOM 杀掉了)。 + # 它失败不影响已经推出去的镜像,只让流水线变红。没带 [CI] 的推送由 e2e.yml 跑。 + - name: backend-e2e-tests + image: bash + when: + - evaluate: 'not (CI_COMMIT_MESSAGE contains "[SKIP TESTS]")' + environment: + NUGET_PACKAGES: /home/justme/.nuget/packages + commands: + - bash ci/verify-backend.sh slow + depends_on: + - build-linux-amd64-backend + - build-linux-amd64-agent + - build-linux-amd64-probe diff --git a/.woodpecker/e2e.yml b/.woodpecker/e2e.yml index ec9246f..63b22fd 100644 --- a/.woodpecker/e2e.yml +++ b/.woodpecker/e2e.yml @@ -8,13 +8,14 @@ clone: settings: lfs: false +# 带 [CI] 的推送会出镜像,慢测试放在 dev-image 里、等镜像构建完再跑(不和 AOT 编译抢内存);这个 workflow 管其余的:PR 和没带 [CI] 的推送 when: - event: pull_request - event: push branch: main + evaluate: 'not (CI_COMMIT_MESSAGE contains "[CI]")' -# 等 verify 编译完、快的测试过了再跑(共用它的增量编译缓存,不重新编译); -# 不挡出镜像:dev-image 只等 verify 和 web-build,这个和出镜像并行,失败照样红 +# 等 verify 编译完、快的测试过了再跑(共用它的增量编译缓存,不重新编译) depends_on: - verify diff --git a/AGENTS.md b/AGENTS.md index 99bfbae..2ba06f1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -7,7 +7,7 @@ MoShiro is a self-hosted network path quality monitor. Backend coordinates Agent ## Branch and workspace safety - `main` is the only working branch (the old `dev` branch is retired and no pipeline uses it). Commit and push to `main` directly; use a pull request when a review is wanted. -- A push to `main` publishes development images only if its commit message contains `[CI]` (for a merged PR, put it in the PR or merge commit title). Without `[CI]` nothing is built; use `[CI SKIP]` to skip the pipeline entirely. The fast Backend tests (`verify`) and the web build run on every `main` push and must pass first; the slow end-to-end tests (`[Trait("Category", "Slow")]`, workflow `e2e`) run alongside the image build and do not block it; `[SKIP TESTS]` skips only the Backend tests. +- A push to `main` publishes development images only if its commit message contains `[CI]` (for a merged PR, put it in the PR or merge commit title). Without `[CI]` nothing is built; use `[CI SKIP]` to skip the pipeline entirely. The fast Backend tests (`verify`) and the web build run on every `main` push and must pass first; the slow end-to-end tests (`[Trait("Category", "Slow")]`) run after the images are built and pushed (inside `dev-image` for `[CI]` pushes, workflow `e2e` otherwise) and never block them; `[SKIP TESTS]` skips only the Backend tests. - Versions are filled in by CI (`ci/version.sh`): a `vX.Y.Z` tag builds exactly `X.Y.Z`; a `[CI]` build on `main` is `vX.Y.(Z+1)-dev.-` (`N` = commits since the latest tag). The `` in `backend/Directory.Build.props` and the `version` in the `web` `package.json` files are placeholders (`0.0.0-dev`); never bump them by hand. - Before editing, inspect `git status`. Preserve pre-existing user changes: do not reset, clean, stash, or include unrelated files in a commit. - Do not commit credentials, API keys, registry passwords, or generated runtime data. CI credentials belong in Woodpecker secrets (`zot_secret`, `gitea_token`, `release_signing_key` for signing release manifests). CI registers the signed manifests at `/api/release/offer`, which needs no token because the panel verifies the signature. The release signing private key never goes into the repository or the panel; only the public key in `packaging/update/` does. diff --git a/docs/ops/deployment.md b/docs/ops/deployment.md index 47727aa..84dead6 100644 --- a/docs/ops/deployment.md +++ b/docs/ops/deployment.md @@ -80,7 +80,7 @@ Pull request 和 `main` 的 push 会跑三个 workflow: - `verify`:后端的快测试(除了标了 `Category=Slow` 的全部,约 20 秒); - `web-build`:前端构建和 CSS 检查,和 `verify` 并行(约 15 秒); -- `e2e`:标了 `Category=Slow` 的端到端测试(真实时间的 Hy2 阶梯、IPv6 和真探针的几条,一百来秒),等 `verify` 编译完之后跑,和出镜像并行,失败照样红,但不拦着出镜像。 +- 标了 `Category=Slow` 的端到端测试(真实时间的 Hy2 阶梯、IPv6 和真探针的几条,一百来秒):带 `[CI]` 的推送,在 `dev-image` 里**等三个镜像都构建、推送完**再跑(不和 NativeAOT 编译抢内存——同时跑过一次,Backend 的 AOT 编译被内存不足杀掉了);PR 和没带 `[CI]` 的推送由 `e2e` workflow 在 `verify` 之后跑。失败照样红,但不影响已经推出去的镜像。 后端测试用增量编译(`ci/verify-backend.sh`):源码按内容同步到 CI 主机上一个固定目录,保留 `obj/bin`,只重编译变了的项目;同一时间只有一条流水线用这份缓存。失败的测试会单独重跑(最多两次),重跑通过算通过。给新的慢测试打标记:`[Trait("Category", "Slow")]`。 @@ -99,7 +99,7 @@ Pull request 和 `main` 的 push 会跑三个 workflow: ### main 开发镜像 -`main` 上只有提交信息包含 `[CI]` 的 push 才构建镜像,并且要等上面的 `verify`(快测试)和 `web-build` 都通过(提交信息写 `[SKIP TESTS]` 可以跳过测试);慢的端到端测试(`e2e`)和出镜像并行,不拦着出镜像。合并 PR 时,请把 `[CI]` 放入 PR 标题或合并提交标题。Backend、Agent、Probe 的 Linux/amd64 镜像会并行构建,并推送到同一个 Zot Registry 下独立的 `moshiro-dev/` 仓库: +`main` 上只有提交信息包含 `[CI]` 的 push 才构建镜像,并且要等上面的 `verify`(快测试)和 `web-build` 都通过(提交信息写 `[SKIP TESTS]` 可以跳过测试);慢的端到端测试在镜像推完之后才跑,不拦着出镜像。合并 PR 时,请把 `[CI]` 放入 PR 标题或合并提交标题。Backend、Agent、Probe 的 Linux/amd64 镜像会并行构建,并推送到同一个 Zot Registry 下独立的 `moshiro-dev/` 仓库: | 镜像 | 滚动标签 | 固定版本标签 | | --- | --- | --- |