feat: 实现测试门禁步骤

This commit is contained in:
2026-06-09 18:09:52 +08:00
parent cecd7ab925
commit 1b69e454d7

View File

@@ -86,9 +86,23 @@ async function stepBumpVersion(): Promise<string> {
return newVersion; return newVersion;
} }
async function runTests(): Promise<void> {
console.log("\n运行测试...");
const proc = Bun.spawn(["bun", "test", "--path-ignore-patterns", "tests/agent/**"], {
stdio: ["inherit", "inherit", "inherit"],
});
const exitCode = await proc.exited;
if (exitCode !== 0) {
throw new Error(`测试失败 (exit code: ${exitCode}),已跳过 git 和发布步骤`);
}
}
async function main(): Promise<void> { async function main(): Promise<void> {
const newVersion = await stepBumpVersion(); const newVersion = await stepBumpVersion();
console.log(`[1/4] 版本号递增完成: ${newVersion}`); console.log(`[1/4] 版本号递增完成: ${newVersion}`);
await runTests();
console.log("[2/4] 测试通过");
} }
main().catch((err: unknown) => { main().catch((err: unknown) => {