switch to start_dependency_installation and await_dependency_installation, fix action play.ts repo

This commit is contained in:
David Blass
2025-12-19 16:29:46 -05:00
parent bd8fc8abdf
commit 5034ff8285
15 changed files with 8183 additions and 8858 deletions
+6 -27
View File
@@ -9,42 +9,21 @@ import { $ } from "./shell.ts";
export interface SetupOptions {
tempDir: string;
forceClean?: boolean;
}
/**
* Setup the test repository for running actions
*/
export function setupTestRepo(options: SetupOptions): void {
const { tempDir, forceClean = false } = options;
const { tempDir } = options;
const repo = process.env.GITHUB_REPOSITORY;
if (!repo) {
throw new Error(
"GITHUB_REPOSITORY environment variable must be specified (e.g. pullfrog/scratch)"
);
}
const cloneUrl = `git@github.com:${repo}.git`;
if (!repo) throw new Error("GITHUB_REPOSITORY is required");
if (existsSync(tempDir)) {
if (forceClean) {
log.info("» removing existing .temp directory...");
rmSync(tempDir, { recursive: true, force: true });
log.info(`» cloning ${repo} into .temp...`);
$("git", ["clone", cloneUrl, tempDir]);
} else {
log.info("» resetting existing .temp repository...");
execSync("git reset --hard HEAD && git clean -fd", {
cwd: tempDir,
stdio: "inherit",
});
}
} else {
log.info(`» cloning ${repo} into .temp...`);
$("git", ["clone", cloneUrl, tempDir]);
log.info("» removing existing .temp directory...");
rmSync(tempDir, { recursive: true, force: true });
}
log.info(`» cloning ${repo} into .temp...`);
$("git", ["clone", `git@github.com:${repo}.git`, tempDir]);
}
/**