[3.12] Move macOS matrix to the calling workflow (GH-121809) (#122330)

This commit is contained in:
Sviatoslav Sydorenko (Святослав Сидоренко) 2024-07-27 11:19:59 +02:00 committed by GitHub
parent 102dc44a0a
commit a4449a1ada
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 33 additions and 20 deletions

View file

@ -286,15 +286,38 @@ jobs:
arch: ${{ matrix.arch }} arch: ${{ matrix.arch }}
build_macos: build_macos:
name: 'macOS' name: >-
macOS
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
needs: check_source needs: check_source
if: needs.check_source.outputs.run_tests == 'true' if: needs.check_source.outputs.run_tests == 'true'
strategy:
fail-fast: false
matrix:
# Cirrus and macos-14 are M1, macos-13 is default GHA Intel.
# macOS 13 only runs tests against the GIL-enabled CPython.
# Cirrus used for upstream, macos-14 for forks.
os:
- ghcr.io/cirruslabs/macos-runner:sonoma
- macos-14
- macos-13
is-fork: # only used for the exclusion trick
- ${{ github.repository_owner != 'python' }}
free-threading:
- false
# - true
exclude:
- os: ghcr.io/cirruslabs/macos-runner:sonoma
is-fork: true
- os: macos-14
is-fork: false
- os: macos-13
free-threading: true
uses: ./.github/workflows/reusable-macos.yml uses: ./.github/workflows/reusable-macos.yml
with: with:
config_hash: ${{ needs.check_source.outputs.config_hash }} config_hash: ${{ needs.check_source.outputs.config_hash }}
# Cirrus and macos-14 are M1, macos-13 is default GHA Intel. free-threading: ${{ matrix.free-threading }}
# Cirrus used for upstream, macos-14 for forks. os: ${{ matrix.os }}
os-matrix: '["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14", "macos-13"]'
build_ubuntu: build_ubuntu:
name: >- name: >-

View file

@ -8,13 +8,14 @@ on:
required: false required: false
type: boolean type: boolean
default: false default: false
os-matrix: os:
required: false description: OS to run the job
required: true
type: string type: string
jobs: jobs:
build_macos: build_macos:
name: build and test (${{ matrix.os }}) name: build and test (${{ inputs.os }})
timeout-minutes: 60 timeout-minutes: 60
env: env:
HOMEBREW_NO_ANALYTICS: 1 HOMEBREW_NO_ANALYTICS: 1
@ -22,18 +23,7 @@ jobs:
HOMEBREW_NO_INSTALL_CLEANUP: 1 HOMEBREW_NO_INSTALL_CLEANUP: 1
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
PYTHONSTRICTEXTENSIONBUILD: 1 PYTHONSTRICTEXTENSIONBUILD: 1
strategy: runs-on: ${{ inputs.os }}
fail-fast: false
matrix:
os: ${{fromJson(inputs.os-matrix)}}
is-fork:
- ${{ github.repository_owner != 'python' }}
exclude:
- os: "ghcr.io/cirruslabs/macos-runner:sonoma"
is-fork: true
- os: "macos-14"
is-fork: false
runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Runner image version - name: Runner image version
@ -42,7 +32,7 @@ jobs:
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: config.cache path: config.cache
key: ${{ github.job }}-${{ matrix.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }} key: ${{ github.job }}-${{ inputs.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
- name: Install Homebrew dependencies - name: Install Homebrew dependencies
run: brew install pkg-config openssl@3.0 xz gdbm tcl-tk run: brew install pkg-config openssl@3.0 xz gdbm tcl-tk
- name: Configure CPython - name: Configure CPython