Skip to content

Further reduce work load for Mac CI pipeline #24197

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

Merged
merged 1 commit into from
Mar 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 12 additions & 0 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ env:
jobs:
cpu:
uses: ./.github/workflows/macos-ci-build-and-test-workflow.yml
with:
# Only build arm64 for CPU
matrix_exclude: >-
[
{"platform_machine": "x86_64"}
]

coreml:
uses: ./.github/workflows/macos-ci-build-and-test-workflow.yml
Expand All @@ -31,6 +37,12 @@ jobs:
uses: ./.github/workflows/macos-ci-build-and-test-workflow.yml
with:
use_xnnpack: true
# only build arm64/Debug for XNNPack
matrix_exclude: >-
[
{"platform_machine": "x86_64"},
{"platform_machine": "arm64", "build_config": "Release"}
]

webgpu:
uses: ./.github/workflows/macos-ci-build-and-test-workflow.yml
Expand Down
29 changes: 14 additions & 15 deletions .github/workflows/macos-ci-build-and-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,26 @@ on:
required: false
type: string
default: "3.11"
matrix_exclude:
required: false
type: string
description: "JSON string specifying combinations to exclude from the matrix"
# we do not have enough resources to run all combinations
# Exclude x86_64 + Debug combination by default
default: >-
[
{"platform_machine": "x86_64", "build_config": "Debug"}
]

jobs:
build-and-test:
strategy:
matrix:
platform_machine: ["x86_64", "arm64"]
build_config: ["Debug", "Release"]
exclude:
# we do not have enough resources to run all combinations
# Exclude x86_64 + Debug combination
- platform_machine: "x86_64"
build_config: "Debug"
include:
- platform_machine: "x86_64"
runs_on: "macos-13"
xcode_version: "14.3.1"
- platform_machine: "arm64"
runs_on: "macos-15"
xcode_version: "16"
max-parallel: 1
exclude: ${{ fromJSON(inputs.matrix_exclude) }}

runs-on: ${{ matrix.runs_on }}
runs-on: ${{ matrix.platform_machine == 'x86_64' && 'macos-13' || 'macos-15' }}
env:
build_flags: >
--build_dir ./build
Expand All @@ -58,6 +56,7 @@ jobs:
${{ inputs.use_coreml && '--use_coreml' || '' }}
--use_vcpkg --use_vcpkg_ms_internal_asset_cache
--config ${{ matrix.build_config }}
xcode_version: ${{ matrix.platform_machine == 'x86_64' && '14.3.1' || '16' }}

steps:
- name: Checkout code
Expand All @@ -68,7 +67,7 @@ jobs:
with:
platform_machine: ${{ matrix.platform_machine }}
python_version: ${{ inputs.python_version }}
xcode_version: ${{ matrix.xcode_version }}
xcode_version: ${{ env.xcode_version }}
use_cache: true

- uses: actions/cache@v3
Expand Down
Loading