Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# PR-time test gate with native Linux, Windows, and macOS coverage.
# Race checks remain on master/manual runs.
# PR-time test gate with native Linux, Windows, macOS, and Go race coverage.
#
# Two PR jobs call the same subtasks used by the local `task check` entrypoint:
# - lint: `task check:static` covers documentation drift, Go vet/gofmt, and
Expand All @@ -10,8 +9,8 @@
# - test: `task check:test` builds bin/one then runs Go + Dashboard tests.
# Build is required because tests/e2e snapshot tests skip when
# bin/one is missing.
# Native Windows and macOS jobs also run on every PR. The master ruleset
# requires lint, test, test-windows, and test-macos before merging.
# Native Windows, macOS, and Go race jobs also run on every PR. The master
# ruleset requires lint, test, test-windows, test-macos, and test-race before merging.
#
# Both jobs need Node + pnpm because sync-web runs `pnpm install` +
# `vite build` against apps/dashboard/.
Expand Down Expand Up @@ -212,9 +211,7 @@ jobs:
run: task check

test-race:
# Race tests are useful but slow on GitHub-hosted runners. Keep them off
# the PR critical path and run them before/after merging to master.
if: github.event_name != 'pull_request'
# Catch Go data races before merging, alongside the other required jobs.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
Expand Down Expand Up @@ -271,11 +268,9 @@ jobs:
exit 1
fi

- name: Build binary
run: task build

- name: Run tests
run: task test
- name: Run Go race tests
# test:go builds the CLI for E2E coverage; Dashboard tests run in test.
run: task test:go

test-macos:
# Run before merging so macOS path and process regressions block PRs.
Expand Down
13 changes: 7 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,16 @@ task pre-push # 推前必跑(含上面所有 + verify-docs)
pre-commit hook 会自动运行与 PR CI 相同的 `task check`;如果当前 checkout 尚未
启用 hook,先运行 `task hooks:install`。hook 会拒绝混合已暂存、未暂存或未跟踪的
文件,确保本地检查的内容与即将提交、随后由 CI 检查的快照一致
4. **必跑** `task pre-push` 全绿(在 PR gate 之外额外运行 Go race detector)
4. **必跑** `task pre-push` 全绿(包含 Go race detector)
5. 推送 + 开 PR

PR CI 在 Linux 上并行执行 `task check:static` 与 `task check:test`,同时在
Windows 上执行 `task check`、macOS 上执行 `task check:test`。master 的保护规则
要求 `lint`、`test`、`test-windows`、`test-macos` 四项检查全部通过才能合并。
PR CI 在 Linux 上并行执行 `task check:static`、`task check:test` 与
`task test:go`(Go race detector),同时在 Windows 上执行 `task check`、
macOS 上执行 `task check:test`。master 的保护规则要求 `lint`、`test`、
`test-windows`、`test-macos`、`test-race` 五项检查全部通过才能合并。
本地 `task check` 和 `task pre-push` 只验证当前操作系统,不能代替其他平台的
CI;`task pre-push` 额外运行 Go race detector,远端 race 检查保留在 master
和手动触发的工作流中
CI;`task pre-push` 额外运行 Go race detector。远端五项检查会在 PR、master
推送和手动触发的工作流中运行

## 改不同部分的注意事项

Expand Down
Loading