8000 🧪💅 Move macOS matrix to the calling workflow · python/cpython@24ee563 · GitHub
[go: up one dir, main page]

Skip to content

Commit 24ee563

Browse files
committed
🧪💅 Move macOS matrix to the calling workflow
Previously, part of it was passed to the reusable workflow where another part was being populated. Now, the entire matrix is defined in a single place, in the calling workflow.
1 parent 94bee45 commit 24ee563

File tree

2 files changed

+39
-22
lines changed

2 files changed

+39
-22
lines changed

‎.github/workflows/build.yml

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,24 +202,51 @@ jobs:
202202
name: 'macOS'
203203
needs: check_source
204204
if: needs.check_source.outputs.run_tests == 'true'
205+
strategy:
206+
fail-fast: false
207+
matrix:
208+
# Cirrus and macos-14 are M1, macos-13 is default GHA Intel.
209+
# Cirrus used for upstream, macos-14 for forks.
210+
os:
211+
- ghcr.io/cirruslabs/macos-runner:sonoma
212+
- macos-14
213+
- macos-13
214+
is-fork: # only used for the exclusion trick
215+
- ${{ github.repository_owner != 'python' }}
216+
exclude:
217+
- os: ghcr.io/cirruslabs/macos-runner:sonoma
218+
is-fork: true
219+
- os: macos-14
220+
is-fork: false
205221
uses: ./.github/workflows/reusable-macos.yml
206222
with:
207223
config_hash: ${{ needs.check_source.outputs.config_hash }}
208-
# Cirrus and macos-14 are M1, macos-13 is default GHA Intel.
209-
# Cirrus used for upstream, macos-14 for forks.
210-
os-matrix: '["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14", "macos-13"]'
224+
os: ${{ matrix.os }}
211225

212226
build_macos_free_threading:
213227
name: 'macOS (free-threading)'
214228
needs: check_source
215229
if: needs.check_source.outputs.run_tests == 'true'
230+
strategy:
231+
fail-fast: false
232+
matrix:
233+
# Cirrus and macos-14 are M1.
234+
# Cirrus used for upstream, macos-14 for forks.
235+
os:
236+
- ghcr.io/cirruslabs/macos-runner:sonoma
237+
- macos-14
238+
is-fork: # only used for the exclusion trick
239+
- ${{ github.repository_owner != 'python' }}
240+
exclude:
241+
- os: ghcr.io/cirruslabs/macos-runner:sonoma
242+
is-fork: true
243+
- os: macos-14
244+
is-fork: false
216245
uses: ./.github/workflows/reusable-macos.yml
217246
with:
218247
config_hash: ${{ needs.check_source.outputs.config_hash }}
219248
free-threading: true
220-
# Cirrus and macos-14 are M1.
221-
# Cirrus used for upstream, macos-14 for forks.
222-
os-matrix: '["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14"]'
249+
os: ${{ matrix.os }}
223250

224251
build_ubuntu:
225252
name: 'Ubuntu'

‎.github/workflows/reusable-macos.yml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ on:
88
required: false
99
type: boolean
1010
default: false
11-
os-matrix:
12-
required: false
11+
os:
12+
description: OS to run the job in
13+
required: true
1314
type: string
1415

1516
jobs:
1617
build_macos:
17-
name: build and test (${{ matrix.os }})
18+
name: build and test (${{ inputs.os }})
1819
timeout-minutes: 60
1920
env:
2021
HOMEBREW_NO_ANALYTICS: 1
@@ -23,18 +24,7 @@ jobs:
2324
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
2425
PYTHONSTRICTEXTENSIONBUILD: 1
2526
TERM: linux
26-
strategy:
27-
fail-fast: false
28-
matrix:
29-
os: ${{fromJson(inputs.os-matrix)}}
30-
is-fork:
31-
- ${{ github.repository_owner != 'python' }}
32-
exclude:
33-
- os: "ghcr.io/cirruslabs/macos-runner:sonoma"
34-
is-fork: true
35-
- os: "macos-14"
36-
is-fork: false
37-
runs-on: ${{ matrix.os }}
27+
runs-on: ${{ inputs.os }}
3828
steps:
3929
- uses: actions/checkout@v4
4030
- name: Runner image version
@@ -43,7 +33,7 @@ jobs:
4333
uses: actions/cache@v4
4434
with:
4535
path: config.cache
46-
key: ${{ github.job }}-${{ matrix.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
36+
key: ${{ github.job }}-${{ inputs.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
4737
- name: Install Homebrew dependencies
4838
run: brew install pkg-config openssl@3.0 xz gdbm tcl-tk
4939
- name: Configure CPython

0 commit comments

Comments
 (0)
0