Skip to content

Conversation

@ZnqbuZ
Copy link
Contributor

@ZnqbuZ ZnqbuZ commented Jan 24, 2026

优化缓存;用 matrix 并行测试,分得越细,跑得越快

一次测试:https://github.com/ZnqbuZ/EasyTier/actions/runs/21316423226/job/61359990173

connector::dns_connector 的单元测试不知道为什么有时特别慢,本地测试也这么慢
db::operations::tests 的测试可能不需要做?

@ZnqbuZ ZnqbuZ marked this pull request as ready for review January 24, 2026 14:46
Copilot AI review requested due to automatic review settings January 24, 2026 14:46
Copy link
Contributor

Copilot AI left a 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.toml to include the quic feature in the full feature set, so CI tests run with QUIC enabled.
  • Replaces the monolithic .github/workflows/test.yml job with separate lint, pre-test (build + archive tests with cargo nextest archive), and matrix test jobs running cargo nextest run over an archived test bundle.
  • Introduces two composite GitHub Actions, prepare-build and prepare-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.

@KKRainbow
Copy link
Member

db这个之前也不跑的吧?

@ZnqbuZ
Copy link
Contributor Author

ZnqbuZ commented Jan 25, 2026

db这个之前也不跑的吧?

应该是,我看日志是只有 easytier 这个 package 的测试,所以就和以前一样只要 easytier 就行吗?

@ZnqbuZ
Copy link
Contributor Author

ZnqbuZ commented Jan 25, 2026

另外 build 缓存配置是不是有点问题,应该是想要所有 target 共享 registry 缓存吧?那应该设一个专用的 shared-key

@KKRainbow
Copy link
Member

不同target没法share吧

@ZnqbuZ
Copy link
Contributor Author

ZnqbuZ commented Jan 25, 2026

不同target没法share吧

我是说 .cargo/registry,是依赖的源码,我看现在的 ci 配置就应该是只缓存这部分

cache-targets: "false"

但是没有 shared-key,这样每个 build target 都会各自生成一份一样的缓存

target 目录太大了,没法给所有 build target 缓存。但所有 build 都是一起运行,所以要么都缓存要么都不缓存,于是就干脆不缓存 target 目录

@KKRainbow
Copy link
Member

之前 cache 利用率应该可以,好像不是很经常遇到存不下 cache 的情况

@ZnqbuZ
Copy link
Contributor Author

ZnqbuZ commented Jan 25, 2026

之前 cache 利用率应该可以,好像不是很经常遇到存不下 cache 的情况

这里有好几个 rust-cache 都是 No cache found

其实我觉得缓存 .cargo/registry 也快不了多少,不如删了(或者只缓存特别慢的 build,并且把 target 也缓存),免得把别的缓存挤走(比如 test 的 target 缓存)。
这里能看到缓存创建时间都是最近几个小时,说明缓存利用率不太好

@ZnqbuZ
Copy link
Contributor Author

ZnqbuZ commented Jan 25, 2026

另外 target 是 windows 的应该用 windows runner 更快点吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants