diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index 33dbd2f69d..ff54c07ebe 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -61,39 +61,39 @@ jobs: include: - os: ubuntu-latest version: stable-v2.17.6 - - os: macos-latest + - os: macos-latest-xlarge version: stable-v2.17.6 - os: ubuntu-latest version: stable-v2.18.4 - - os: macos-latest + - os: macos-latest-xlarge version: stable-v2.18.4 - os: ubuntu-latest version: stable-v2.19.4 - - os: macos-latest + - os: macos-latest-xlarge version: stable-v2.19.4 - os: ubuntu-latest version: stable-v2.20.7 - - os: macos-latest + - os: macos-latest-xlarge version: stable-v2.20.7 - os: ubuntu-latest version: stable-v2.21.4 - - os: macos-latest + - os: macos-latest-xlarge version: stable-v2.21.4 - os: ubuntu-latest version: stable-v2.22.4 - - os: macos-latest + - os: macos-latest-xlarge version: stable-v2.22.4 - os: ubuntu-latest version: default - - os: macos-latest + - os: macos-latest-xlarge version: default - os: ubuntu-latest version: linked - - os: macos-latest + - os: macos-latest-xlarge version: linked - os: ubuntu-latest version: nightly-latest - - os: macos-latest + - os: macos-latest-xlarge version: nightly-latest name: Multi-language repository if: github.triggering_actor != 'dependabot[bot]' diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index 473c136441..cd26309f4e 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -39,7 +39,7 @@ jobs: fail-fast: false matrix: include: - - os: macos-latest + - os: macos-latest-xlarge version: nightly-latest name: Swift analysis using autobuild if: github.triggering_actor != 'dependabot[bot]' diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 0b32bc20e8..9f14b05bf3 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -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-14-xlarge,macos-15-xlarge] tools: ${{ fromJson(needs.check-codeql-versions.outputs.versions) }} runs-on: ${{ matrix.os }} diff --git a/package.json b/package.json index d46e507923..5125ea0d86 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "ava": "npm run transpile && ava --verbose", "test": "npm run ava -- src/", "test-debug": "npm run test -- --timeout=20m", - "transpile": "tsc --build --verbose tsconfig.json" + "transpile": "tsc --build --verbose tsconfig.json", + "update-pr-checks": "./pr-checks/sync.sh" }, "license": "MIT", "workspaces": [ diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index e005a9239d..c52dcf9401 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -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 diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index e9949c12e7..393857cd2c 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -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 diff --git a/pr-checks/sync.ts b/pr-checks/sync.ts index e46fca2483..c810e7cbf8 100755 --- a/pr-checks/sync.ts +++ b/pr-checks/sync.ts @@ -28,6 +28,24 @@ interface WorkflowInput { /** A partial mapping from known input names to input definitions. */ type WorkflowInputs = Partial>; +/** An operating system identifier. */ +type OperatingSystemIdentifier = "ubuntu" | "macos" | "windows"; + +/** + * Represents an operating system matrix entry for a generated PR check workflow. + * + * Either a string containing the OS identifier or an object containing the OS identifier and an + * optional runner image label. + */ +type OperatingSystem = + | OperatingSystemIdentifier + | { + /** OS identifier. */ + os: OperatingSystemIdentifier; + /** Optional runner image label. */ + "runner-image"?: string; + }; + /** * Represents PR check specifications. */ @@ -36,8 +54,8 @@ interface Specification extends JobSpecification { inputs?: Record; /** 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"]`). */ - operatingSystems?: string[]; + /** Operating system prefixes, either as strings or with explicit runner image labels. */ + operatingSystems?: OperatingSystem[]; /** Per-OS version overrides. If specified for an OS, only those versions are tested on that OS. */ osCodeQlVersions?: Record; /** Whether to use the all-platform CodeQL bundle. */ @@ -311,10 +329,19 @@ 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]; @@ -322,9 +349,13 @@ function generateJobMatrix( 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({