Skip to content

Commit 0b695fe

Browse files
authored
Define kind sorting to put tsc first (#10)
1 parent 096f2da commit 0b695fe

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

scripts/src/generateMatrix.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import assert from "node:assert";
2+
13
import minimist from "minimist";
24

35
import { setOutputVariable } from "./utils.js";
@@ -238,8 +240,13 @@ for (const [agent, value] of Object.entries(matrix)) {
238240
console.log(JSON.stringify(value, undefined, 4));
239241
}
240242

243+
// This defines the sort order, which is seen in PR replies; tsc is the most important and should be first.
244+
const kindOrder: readonly JobKind[] = ["tsc", "tsserver", "startup"];
245+
246+
assert.deepStrictEqual([...allJobKinds].sort(), [...kindOrder].sort(), "kindOrder must contain all job kinds");
247+
241248
// These are outputs for the ProcessResults job, specifying which results were
242249
// produced previously and need to be processed. This is a space separated list,
243250
// iterated in the pipeline in bash.
244-
setOutputVariable(`TSPERF_PROCESS_KINDS`, [...processKinds].sort().join(" "));
251+
setOutputVariable(`TSPERF_PROCESS_KINDS`, kindOrder.filter(kind => processKinds.has(kind)).join(" "));
245252
setOutputVariable(`TSPERF_PROCESS_LOCATIONS`, [...processLocations].sort().join(","));

0 commit comments

Comments
 (0)