-
Notifications
You must be signed in to change notification settings - Fork 495
PR checks: Run slowest macOS checks on larger runners #3903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
fcdf5dd
aa005fa
a32db48
1b65777
931147e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,13 @@ interface WorkflowInput { | |
| /** A partial mapping from known input names to input definitions. */ | ||
| type WorkflowInputs = Partial<Record<KnownInputName, WorkflowInput>>; | ||
|
|
||
| type OperatingSystem = | ||
| | string | ||
| | { | ||
| os: string; | ||
| "runner-image"?: string; | ||
| }; | ||
|
Comment on lines
+40
to
+47
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor: JSDocs? Perhaps rather than having the extended description below, move some of that here and then simplify the doc for
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also wonder if having both
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added JSDoc and a more specific type for |
||
|
|
||
| /** | ||
| * Represents PR check specifications. | ||
| */ | ||
|
|
@@ -37,7 +44,7 @@ interface Specification extends JobSpecification { | |
| /** CodeQL bundle versions to test against. Defaults to `DEFAULT_TEST_VERSIONS`. */ | ||
| versions?: string[]; | ||
| /** Operating system prefixes used to select runner images (e.g. `["ubuntu", "macos"]`). */ | ||
|
henrymercer marked this conversation as resolved.
Outdated
|
||
| operatingSystems?: string[]; | ||
| operatingSystems?: OperatingSystem[]; | ||
| /** Per-OS version overrides. If specified for an OS, only those versions are tested on that OS. */ | ||
| osCodeQlVersions?: Record<string, string[]>; | ||
| /** Whether to use the all-platform CodeQL bundle. */ | ||
|
|
@@ -311,20 +318,33 @@ function generateJobMatrix( | |
| ); | ||
| } | ||
|
|
||
| const runnerImages = ["ubuntu-latest", "macos-latest", "windows-latest"]; | ||
| const defaultRunnerImages = [ | ||
| "ubuntu-latest", | ||
| "macos-latest", | ||
| "windows-latest", | ||
| ]; | ||
| const operatingSystems = checkSpecification.operatingSystems ?? ["ubuntu"]; | ||
|
|
||
| for (const operatingSystem of operatingSystems) { | ||
| for (const operatingSystemConfig of operatingSystems) { | ||
| const operatingSystem = | ||
| typeof operatingSystemConfig === "string" | ||
| ? operatingSystemConfig | ||
| : operatingSystemConfig.os; | ||
|
|
||
| // If osCodeQlVersions is set for this OS, only include the specified CodeQL versions. | ||
| const allowedVersions = | ||
| checkSpecification.osCodeQlVersions?.[operatingSystem]; | ||
| if (allowedVersions && !allowedVersions.includes(version)) { | ||
| continue; | ||
| } | ||
|
|
||
| const runnerImagesForOs = runnerImages.filter((image) => | ||
| image.startsWith(operatingSystem), | ||
| ); | ||
| const runnerImagesForOs = | ||
| typeof operatingSystemConfig === "string" || | ||
| operatingSystemConfig["runner-image"] === undefined | ||
| ? defaultRunnerImages.filter((image) => | ||
| image.startsWith(operatingSystem), | ||
| ) | ||
| : [operatingSystemConfig["runner-image"]]; | ||
|
|
||
| for (const runnerImage of runnerImagesForOs) { | ||
| matrix.push({ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.