Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
PR checks: Run slowest macOS checks on larger runners
  • Loading branch information
henrymercer committed May 14, 2026
commit aa005faaad68ba76e579afbcdc6b87297c3b291a
2 changes: 1 addition & 1 deletion .github/workflows/__all-platform-bundle.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions .github/workflows/__multi-language-autodetect.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/__swift-autobuild.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .github/workflows/__swift-custom-build.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04,ubuntu-24.04,windows-2022,windows-2025,macos-14,macos-15]
os: [ubuntu-22.04,ubuntu-24.04,windows-2022,windows-2025,macos-latest-xlarge]
Comment thread
henrymercer marked this conversation as resolved.
Outdated
tools: ${{ fromJson(needs.check-codeql-versions.outputs.versions) }}
runs-on: ${{ matrix.os }}

Expand Down
3 changes: 2 additions & 1 deletion pr-checks/checks/all-platform-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: "All-platform bundle"
description: "Tests using an all-platform CodeQL Bundle"
operatingSystems:
- ubuntu
- macos
- os: macos
runner-image: macos-latest-xlarge
- windows
versions:
- nightly-latest
Expand Down
3 changes: 2 additions & 1 deletion pr-checks/checks/multi-language-autodetect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: "Multi-language repository"
description: "An end-to-end integration test of a multi-language repository using automatic language detection"
operatingSystems:
- ubuntu
- macos
- os: macos
runner-image: macos-latest-xlarge
env:
CODEQL_ACTION_RESOLVE_SUPPORTED_LANGUAGES_USING_CLI: true
installGo: true
Expand Down
3 changes: 2 additions & 1 deletion pr-checks/checks/swift-autobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ description: "Tests creation of a Swift database using autobuild"
versions:
- nightly-latest
operatingSystems:
- macos
- os: macos
runner-image: macos-latest-xlarge
steps:
- uses: ./../action/init
id: init
Expand Down
3 changes: 2 additions & 1 deletion pr-checks/checks/swift-custom-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ versions:
- default
- nightly-latest
operatingSystems:
- macos
- os: macos
runner-image: macos-latest-xlarge
installGo: true
installDotNet: true
env:
Expand Down
32 changes: 26 additions & 6 deletions pr-checks/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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 operatingSystems.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also wonder if having both os and runner-image is a bit redundant since runner-image typically starts with the os string, so you could infer os from runner-image when that's specified.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added JSDoc and a more specific type for os. You're right that we could probably infer runner-image but there's no guarantee about the structure of the labels in general so I'll leave this as is.


/**
* Represents PR check specifications.
*/
Expand All @@ -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"]`). */
Comment thread
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. */
Expand Down Expand Up @@ -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({
Expand Down
Loading