优化 Gitea CI Rust 分片并发
Project CI / AI game creator shell Rust crates (push) Successful in 53s
Project CI / AI game creator shell Rust smoke (push) Successful in 1m58s
Project CI / AI game creator shell Rust lane 2/2 (push) Failing after 6m40s
Project CI / AI game creator shell Rust lane 1/2 (push) Failing after 9m54s
Project CI / Frontend tests (push) Failing after 5m2s
Project CI / Backend tests (push) Successful in 8m9s
Project CI / Repository checks (push) Successful in 4m7s
Project CI / Native shell tests (push) Successful in 8m58s
Project CI / AI game creator shell web tests (push) Successful in 3m9s
Project CI / AI game creator shell Rust crates (push) Successful in 53s
Project CI / AI game creator shell Rust smoke (push) Successful in 1m58s
Project CI / AI game creator shell Rust lane 2/2 (push) Failing after 6m40s
Project CI / AI game creator shell Rust lane 1/2 (push) Failing after 9m54s
Project CI / Frontend tests (push) Failing after 5m2s
Project CI / Backend tests (push) Successful in 8m9s
Project CI / Repository checks (push) Successful in 4m7s
Project CI / Native shell tests (push) Successful in 8m58s
Project CI / AI game creator shell web tests (push) Successful in 3m9s
将四个 AGC Rust shard 合并为两条 lane,减少重复预热与排队 同步 workflow 契约测试、分片说明和运维文档
This commit is contained in:
@@ -87,8 +87,8 @@ const aiGameCreatorViteConfigSource = fs.readFileSync(
|
||||
// - agc-web:AI 游戏创作壳的前端门禁(typecheck 与壳内测试,不触碰 Cargo)。
|
||||
// - agc-rust-crates:AGC 壳依赖的共享 / 平台 crate 测试(server-rs workspace 加两个
|
||||
// 无锁独立 crate),只需 server-rs 侧的依赖预热。
|
||||
// - agc-rust-shard-1..4:AGC 壳自身的 Rust bin target 单测,按名单切成 4 片,一片一个
|
||||
// 分组(CI 里就是一个 job),片内仍保持 `--test-threads=1`;每个分片分组都会做一次
|
||||
// - agc-rust-shard-1..4:AGC 壳自身的 Rust bin target 单测,按名单切成 4 片,片内仍保持
|
||||
// `--test-threads=1`;CI 由两条 lane job 各顺序运行两片,每个分片分组都会做一次
|
||||
// 「片并集等于全集且互斥」的自校验。
|
||||
// - agc-rust-smoke:会用 `src-tauri/Cargo.toml` spawn `cargo run` 的 agent-run smoke。
|
||||
// 与分片分开,免得把已经压到 4 分钟级的片 job 拖长。
|
||||
@@ -2321,7 +2321,7 @@ const steps = [
|
||||
// AI 游戏创作壳原先一步串完 typecheck、壳内测试、共享 / 平台 crate 测试和
|
||||
// 串行壳测试,CI 因此只有一条 10 分钟以上的长尾。这里按同一组命令切成
|
||||
// web、rust-crates、rust 分片、smoke 四段,整体顺序与 `npm run ai-game-creator-shell:check`
|
||||
// 完全一致;CI 把每段(以及每个 rust 分片)放进不同 job 并行执行,本地全量运行仍然是
|
||||
// 完全一致;CI 把各组放进 job,Rust 分片由两条 lane 顺序承载,本地全量运行仍然是
|
||||
// web -> rust(crates -> shards) -> smoke 原顺序。
|
||||
{
|
||||
group: 'agc-web',
|
||||
|
||||
@@ -56,10 +56,8 @@ const jobNames = [
|
||||
'backend-tests',
|
||||
'native-shell-tests',
|
||||
'ai-game-creator-shell-web-tests',
|
||||
'ai-game-creator-shell-rust-shard-1',
|
||||
'ai-game-creator-shell-rust-shard-2',
|
||||
'ai-game-creator-shell-rust-shard-3',
|
||||
'ai-game-creator-shell-rust-shard-4',
|
||||
'ai-game-creator-shell-rust-lane-1',
|
||||
'ai-game-creator-shell-rust-lane-2',
|
||||
'ai-game-creator-shell-rust-smoke',
|
||||
'ai-game-creator-shell-rust-crates',
|
||||
] as const;
|
||||
@@ -69,10 +67,8 @@ const jobNames = [
|
||||
// 都不需要 node_modules。省掉这些 `npm ci`(各 1~3 分钟)是把客户端 Rust 关键路径
|
||||
// 压到 7 分钟以内的前提,因此这里显式允许它们不装 npm 依赖。
|
||||
const jobsWithoutNpmInstall: readonly string[] = [
|
||||
'ai-game-creator-shell-rust-shard-1',
|
||||
'ai-game-creator-shell-rust-shard-2',
|
||||
'ai-game-creator-shell-rust-shard-3',
|
||||
'ai-game-creator-shell-rust-shard-4',
|
||||
'ai-game-creator-shell-rust-lane-1',
|
||||
'ai-game-creator-shell-rust-lane-2',
|
||||
'ai-game-creator-shell-rust-smoke',
|
||||
'ai-game-creator-shell-rust-crates',
|
||||
];
|
||||
@@ -465,26 +461,26 @@ describe('project CI workflow', () => {
|
||||
'plugins/agc-godot-editor/src/entry.test.mjs',
|
||||
);
|
||||
|
||||
// 壳 bin 单测按名单分 4 片,一片一个 job:每个片 job 只跑自己那片,且只预热 AGC 壳
|
||||
// 自己那份锁定依赖(server-rs 那份归 crate 级 job)。
|
||||
for (const [index, jobName] of [
|
||||
[1, 'ai-game-creator-shell-rust-shard-1'],
|
||||
[2, 'ai-game-creator-shell-rust-shard-2'],
|
||||
[3, 'ai-game-creator-shell-rust-shard-3'],
|
||||
[4, 'ai-game-creator-shell-rust-shard-4'],
|
||||
// 壳 bin 单测仍按名单分 4 片,但由两条 lane 各顺序运行两片;每条 lane 只预热
|
||||
// 一次 AGC 壳自己的锁定依赖(server-rs 那份归 crate 级 job)。
|
||||
for (const [laneName, indexes] of [
|
||||
['ai-game-creator-shell-rust-lane-1', [1, 2]],
|
||||
['ai-game-creator-shell-rust-lane-2', [3, 4]],
|
||||
] as const) {
|
||||
const shardJob = jobSection(jobName);
|
||||
expect(shardJob).toContain(
|
||||
`run: npm run check:native-shells:agc-rust-shard-${index}`,
|
||||
);
|
||||
expect(shardJob).toContain(
|
||||
const laneJob = jobSection(laneName);
|
||||
for (const index of indexes) {
|
||||
expect(laneJob).toContain(
|
||||
`run: npm run check:native-shells:agc-rust-shard-${index}`,
|
||||
);
|
||||
}
|
||||
expect(laneJob).toContain(
|
||||
'apps/ai-game-creator-shell/src-tauri/Cargo.toml',
|
||||
);
|
||||
expect(shardJob).toContain('cargo fetch --locked');
|
||||
expect(shardJob).not.toContain('server-rs/Cargo.toml');
|
||||
expect(laneJob).toContain('cargo fetch --locked');
|
||||
expect(laneJob).not.toContain('server-rs/Cargo.toml');
|
||||
}
|
||||
|
||||
// 整套用例不能再作为一条命令串行跑完:每个片 job 都必须落到分片运行器的
|
||||
// 整套用例不能再作为一条命令串行跑完:每个分片调用都必须落到分片运行器的
|
||||
// `--shard-index` 上,4 个 index 各一次。
|
||||
for (const index of [1, 2, 3, 4]) {
|
||||
expect(nativeShellGateScript).toContain(`'--shard-index=${index}'`);
|
||||
|
||||
Reference in New Issue
Block a user