fix(ci): share provider workflows to restore static gates

This commit is contained in:
morluto
2026-10-10 23:15:02 +08:00
parent bddddccdee
commit a97bd5ed29
22 changed files with 290 additions and 304 deletions
+27
View File
@@ -0,0 +1,27 @@
import { createCli } from "../../../src/cli.js";
/** Captured CLI invocation for boundary tests. */
export interface ServedCli {
readonly stdout: string;
readonly exitCode: number;
}
/** Serve one CLI invocation with captured output and exit code. */
export const serveCli = async (
argv: readonly string[],
environment: Readonly<Record<string, string | undefined>> = {},
): Promise<ServedCli> => {
const cli = createCli(environment);
let stdout = "";
let exitCode = 0;
await cli.serve([...argv], {
env: {},
exit: (code) => {
exitCode = code;
},
stdout: (text) => {
stdout += text;
},
});
return { stdout, exitCode };
};