Skip to content

Commit 63b4776

Browse files
committed
Add matrix construction
1 parent 6932b1c commit 63b4776

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

pr-checks/sync.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,34 @@ function main(): void {
156156
workflowInputs = checkSpecification.inputs;
157157
}
158158

159+
let matrix: Array<Record<string, any>> = [];
160+
161+
for (const version of checkSpecification.versions ?? defaultTestVersions) {
162+
if (version === "latest") {
163+
throw new Error(
164+
'Did not recognise "version: latest". Did you mean "version: linked"?',
165+
);
166+
}
167+
168+
const runnerImages = ["ubuntu-latest", "macos-latest", "windows-latest"];
169+
const operatingSystems = checkSpecification.operatingSystems ?? [
170+
"ubuntu",
171+
];
172+
173+
for (const operatingSystem of operatingSystems) {
174+
const runnerImagesForOs = runnerImages.filter((image) =>
175+
image.startsWith(operatingSystem),
176+
);
177+
178+
for (const runnerImage of runnerImagesForOs) {
179+
matrix.push({
180+
os: runnerImage,
181+
version,
182+
});
183+
}
184+
}
185+
}
186+
159187
let extraGroupName = "";
160188
for (const inputName of Object.keys(workflowInputs)) {
161189
extraGroupName += "-${{inputs." + inputName + "}}";

0 commit comments

Comments
 (0)