feat: 实现测试门禁步骤
This commit is contained in:
@@ -86,9 +86,23 @@ async function stepBumpVersion(): Promise<string> {
|
||||
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> {
|
||||
const newVersion = await stepBumpVersion();
|
||||
console.log(`[1/4] 版本号递增完成: ${newVersion}`);
|
||||
|
||||
await runTests();
|
||||
console.log("[2/4] 测试通过");
|
||||
}
|
||||
|
||||
main().catch((err: unknown) => {
|
||||
|
||||
Reference in New Issue
Block a user