8000 Move macOS matrix to the calling workflow by webknjaz · Pull Request #121809 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

Move macOS matrix to the calling workflow #121809

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 3 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
🧪💅 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.
  • Loading branch information
webknjaz committed Jul 15, 2024
commit 66a5dcd62db51491199bfed649f515912b36ff46
39 changes: 33 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,24 +202,51 @@ jobs:
name: 'macOS'
needs: check_source
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.
# 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' }}
exclude:
- os: ghcr.io/cirruslabs/macos-runner:sonoma
is-fork: true
- os: macos-14
is-fork: false
uses: ./.github/workflows/reusable-macos.yml
with:
config_hash: ${{ needs.check_source.outputs.config_hash }}< 8000 /span>
# Cirrus and macos-14 are M1, macos-13 is default GHA Intel.
# Cirrus used for upstream, macos-14 for forks.
os-matrix: '["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14", "macos-13"]'
os: ${{ matrix.os }}

build_macos_free_threading:
name: 'macOS (free-threading)'
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
strategy:
fail-fast: false
matrix:
# Cirrus and macos-14 are M1.
# Cirrus used for upstream, macos-14 for forks.
os:
- ghcr.io/cirruslabs/macos-runner:sonoma
- macos-14
is-fork: # only used for the exclusion trick
- ${{ github.repository_owner != 'python' }}
exclude:
- os: ghcr.io/cirruslabs/macos-runner:sonoma
is-fork: true
- os: macos-14
is-fork: false
uses: ./.github/workflows/reusable-macos.yml
with:
config_hash: ${{ needs.check_source.outputs.config_hash }}
free-threading: true
# Cirrus and macos-14 are M1.
# Cirrus used for upstream, macos-14 for forks.
os-matrix: '["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14"]'
os: ${{ matrix.os }}

build_ubuntu:
name: 'Ubuntu'
Expand Down
22 changes: 6 additions & 16 deletions .github/workflows/reusable-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ on:
required: false
type: boolean
default: false
os-matrix:
required: false
os:
description: OS to run the job in
required: true
type: string

jobs:
build_macos:
name: build and test (${{ matrix.os }})
name: build and test (${{ inputs.os }})
timeout-minutes: 60
env:
HOMEBREW_NO_ANALYTICS: 1
Expand All @@ -23,18 +24,7 @@ jobs:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
PYTHONSTRICTEXTENSIONBUILD: 1
TERM: linux
strategy:
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 }}
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
- name: Runner image version
Expand All @@ -43,7 +33,7 @@ jobs:
uses: actions/cache@v4
with:
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
run: brew install pkg-config openssl@3.0 xz gdbm tcl-tk
- name: Configure CPython
Expand Down
0