perf(test): cache parsed release workflows (#126673)

This commit is contained in:
Peter Steinberger
2026-08-20 06:28:31 -07:00
committed by GitHub
parent e1051ceea3
commit 0d43ade926
@@ -192,8 +192,16 @@ type Workflow = {
};
};
const parsedWorkflows = new Map<string, Workflow>();
function readWorkflow(path: string): Workflow {
return parse(readFileSync(path, "utf8")) as Workflow;
const cachedWorkflow = parsedWorkflows.get(path);
if (cachedWorkflow) {
return cachedWorkflow;
}
const workflow = parse(readFileSync(path, "utf8")) as Workflow;
parsedWorkflows.set(path, workflow);
return workflow;
}
function workflowPaths(): string[] {