8000 [3.12] Move macOS matrix to the calling workflow (GH-121809) (#122330) · python/cpython@a4449a1 · GitHub
[go: up one dir, main page]

Skip to content

Commit a4449a1

Browse files
authored
[3.12] Move macOS matrix to the calling workflow (GH-121809) (#122330)
1 parent 102dc44 commit a4449a1

File tree

2 files changed

+33
-20
lines changed

2 files changed

+33
-20
lines changed

.github/workflows/build.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,15 +286,38 @@ jobs:
286286
arch: ${{ matrix.arch }}
287287

288288
build_macos:
289-
name: 'macOS'
289+
name: >-
290+
macOS
291+
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
290292
needs: check_source
291293
if: needs.check_source.outputs.run_tests == 'true'
294+
strategy:
295+
fail-fast: false
296+
matrix:
297+
# Cirrus and macos-14 are M1, macos-13 is default GHA Intel.
298+
# macOS 13 only runs tests against the GIL-enabled CPython.
299+
# Cirrus used for upstream, macos-14 for forks.
300+
os:
301+
- ghcr.io/cirruslabs/macos-runner:sonoma
302+
- macos-14
303+
- macos-13
304+
is-fork: # only used for the exclusion trick
305+
- ${{ github.repository_owner != 'python' }}
306+
free-threading:
307+
- false
308+
# - true
309+
exclude:
310+
- os: ghcr.io/cirruslabs/macos-runner:sonoma
311+
is-fork: true
312+
- os: macos-14
313+
is-fork: false
314+
- os: macos-13
315+
free-threading: true
292316
uses: ./.github/workflows/reusable-macos.yml
293317
with:
294318
config_hash: ${{ needs.check_source.outputs.config_hash }}
295-
# Cirrus and macos-14 are M1, macos-13 is default GHA Intel.
296-
# Cirrus used for upstream, macos-14 for forks.
297-
os-matrix: '["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14", "macos-13"]'
319+
free-threading: ${{ matrix.free-threading }}
320+
os: ${{ matrix.os }}
298321

299322
build_ubuntu:
300323
name: >-

.github/workflows/reusable-macos.yml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,22 @@ 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
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
2122
HOMEBREW_NO_AUTO_UPDATE: 1
2223
HOMEBREW_NO_INSTALL_CLEANUP: 1
2324
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
2425
PYTHONSTRICTEXTENSIONBUILD: 1
25-
strategy:
26-
fail-fast: false
27-
matrix:
28-
os: ${{fromJson(inputs.os-matrix)}}
29-
is-fork:
30-
- ${{ github.repository_owner != 'python' }}
31-
exclude:
32-
- os: "ghcr.io/cirruslabs/macos-runner:sonoma"
33-
is-fork: true
34-
- os: "macos-14"
35-
is-fork: false
36-
runs-on: ${{ matrix.os }}
26+
runs-on: ${{ inputs.os }}
3727
steps:
3828
- uses: actions/checkout@v4
3929
- name: Runner image version
@@ -42,7 +32,7 @@ jobs:
4232
uses: actions/cache@v4
4333
with:
4434
path: config.cache
45-
key: ${{ github.job }}-${{ matrix.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
35+
key: ${{ github.job }}-${{ inputs.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
4636
- name: Install Homebrew dependencies
4737
run: brew install pkg-config openssl@3.0 xz gdbm tcl-tk
4838
- name: Configure CPython

0 commit comments

Comments
 (0)
0