diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 47eea1b78a..a0befab677 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ concurrency: env: # Path format pulled from https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#xcode - DEVELOPER_DIR: /Applications/Xcode_26.0.1.app + DEVELOPER_DIR: /Applications/Xcode_26.0.app jobs: build_and_test: @@ -31,7 +31,7 @@ jobs: strategy: matrix: # Add additional Xcode versions here if necessary. - xcode: ["Xcode_26.0.1", "Xcode_16.4"] + xcode: ["Xcode_26.0", "Xcode_16.4"] steps: - name: Set Xcode version @@ -43,10 +43,10 @@ jobs: - name: Check Xcode version if: ${{ matrix.xcode != 'Xcode_16.4' }} run: | - Scripts/check_xcode_version.py + Scripts/check_xcode_version.py --relaxed - name: Download Metal toolchain - if: ${{ matrix.xcode == 'Xcode_26.0.1' }} + if: ${{ matrix.xcode == 'Xcode_26.0' }} run: | xcodebuild -downloadComponent MetalToolchain diff --git a/Scripts/check_xcode_version.py b/Scripts/check_xcode_version.py index e083e9cea7..7349cea003 100755 --- a/Scripts/check_xcode_version.py +++ b/Scripts/check_xcode_version.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 +import argparse import subprocess @@ -14,9 +15,22 @@ def get_expected_version(): return file.read().rstrip() +def without_patch_version(value): + components = value.split(".") + return ".".join(components[:2]) + + def main(): + parser = argparse.ArgumentParser() + parser.add_argument( + "--relaxed", action="store_true", help="ignore patch version when comparing" + ) + ns = parser.parse_args() actual_version = get_actual_version() expected_version = get_expected_version() + if ns.relaxed: + actual_version = without_patch_version(actual_version) + expected_version = without_patch_version(expected_version) if actual_version != expected_version: print( f"You’re using {actual_version} but you should be using {expected_version}."