-
Notifications
You must be signed in to change notification settings - Fork 902
ci: 用 matrix 加速测试 #1830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
ci: 用 matrix 加速测试 #1830
Conversation
This reverts commit 6cc7176.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the CI test workflow to speed up Rust tests by introducing cargo nextest with a sharded test matrix and by extracting common setup logic into reusable composite actions. It also aligns the full feature set with the default feature set by including QUIC support.
Changes:
- Updates
easytier/Cargo.tomlto include thequicfeature in thefullfeature set, so CI tests run with QUIC enabled. - Replaces the monolithic
.github/workflows/test.ymljob with separatelint,pre-test(build + archive tests withcargo nextest archive), and matrixtestjobs runningcargo nextest runover an archived test bundle. - Introduces two composite GitHub Actions,
prepare-buildandprepare-pnpm, to centralize frontend and GUI/Rust toolchain setup, and wires them into the workflow.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
easytier/Cargo.toml |
Adds quic to the full feature list so that CI tests using --features=full also exercise QUIC-related code. |
.github/workflows/test.yml |
Splits CI into lint, pre-test, and matrix test jobs, switches to cargo nextest with filter expressions to isolate slow test groups, and introduces shared env plus caching. |
.github/actions/prepare-pnpm/action.yml |
New composite action that sets up Node.js and pnpm, configures pnpm cache, and installs/builds frontend dependencies with a configurable filter. |
.github/actions/prepare-build/action.yml |
New composite action that prepares the GUI/frontend environment, installs Rust toolchain and protoc, and is reused by multiple jobs to DRY up CI setup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
db这个之前也不跑的吧? |
应该是,我看日志是只有 easytier 这个 package 的测试,所以就和以前一样只要 easytier 就行吗? |
|
另外 build 缓存配置是不是有点问题,应该是想要所有 target 共享 registry 缓存吧?那应该设一个专用的 shared-key |
|
不同target没法share吧 |
我是说 .cargo/registry,是依赖的源码,我看现在的 ci 配置就应该是只缓存这部分 EasyTier/.github/workflows/core.yml Line 163 in 101f416
但是没有 shared-key,这样每个 build target 都会各自生成一份一样的缓存 target 目录太大了,没法给所有 build target 缓存。但所有 build 都是一起运行,所以要么都缓存要么都不缓存,于是就干脆不缓存 target 目录 |
|
之前 cache 利用率应该可以,好像不是很经常遇到存不下 cache 的情况 |
|
另外 target 是 windows 的应该用 windows runner 更快点吧 |
优化缓存;用 matrix 并行测试,分得越细,跑得越快
一次测试:https://github.com/ZnqbuZ/EasyTier/actions/runs/21316423226/job/61359990173
connector::dns_connector 的单元测试不知道为什么有时特别慢,本地测试也这么慢
db::operations::tests 的测试可能不需要做?