2023-10-29 03:12:16 -03:00
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
config_hash:
|
|
|
|
required: true
|
|
|
|
type: string
|
2024-01-01 20:16:53 -04:00
|
|
|
free-threading:
|
2023-10-29 04:20:11 -03:00
|
|
|
required: false
|
|
|
|
type: boolean
|
|
|
|
default: false
|
2024-03-14 12:10:56 -03:00
|
|
|
os-matrix:
|
|
|
|
required: false
|
|
|
|
type: string
|
2023-10-29 03:12:16 -03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_macos:
|
2024-06-06 08:40:37 -03:00
|
|
|
name: build and test (${{ matrix.os }})
|
2023-10-29 03:12:16 -03:00
|
|
|
timeout-minutes: 60
|
|
|
|
env:
|
|
|
|
HOMEBREW_NO_ANALYTICS: 1
|
|
|
|
HOMEBREW_NO_AUTO_UPDATE: 1
|
|
|
|
HOMEBREW_NO_INSTALL_CLEANUP: 1
|
2024-02-28 01:35:25 -04:00
|
|
|
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
|
2023-10-29 03:12:16 -03:00
|
|
|
PYTHONSTRICTEXTENSIONBUILD: 1
|
2024-05-05 16:32:23 -03:00
|
|
|
TERM: linux
|
2024-01-31 21:35:48 -04:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-03-14 12:10:56 -03:00
|
|
|
os: ${{fromJson(inputs.os-matrix)}}
|
2024-06-06 08:40:37 -03:00
|
|
|
is-fork:
|
|
|
|
- ${{ github.repository_owner != 'python' }}
|
|
|
|
exclude:
|
|
|
|
- os: "ghcr.io/cirruslabs/macos-runner:sonoma"
|
|
|
|
is-fork: true
|
|
|
|
- os: "macos-14"
|
|
|
|
is-fork: false
|
2024-01-31 21:35:48 -04:00
|
|
|
runs-on: ${{ matrix.os }}
|
2023-10-29 03:12:16 -03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2024-02-13 15:35:06 -04:00
|
|
|
- name: Runner image version
|
|
|
|
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
|
2023-10-29 03:12:16 -03:00
|
|
|
- name: Restore config.cache
|
2024-02-01 06:49:07 -04:00
|
|
|
uses: actions/cache@v4
|
2023-10-29 03:12:16 -03:00
|
|
|
with:
|
|
|
|
path: config.cache
|
2024-02-13 15:35:06 -04:00
|
|
|
key: ${{ github.job }}-${{ matrix.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
|
2023-10-29 03:12:16 -03:00
|
|
|
- name: Install Homebrew dependencies
|
|
|
|
run: brew install pkg-config openssl@3.0 xz gdbm tcl-tk
|
|
|
|
- name: Configure CPython
|
|
|
|
run: |
|
|
|
|
GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
|
|
|
|
GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
|
|
|
|
./configure \
|
|
|
|
--config-cache \
|
|
|
|
--with-pydebug \
|
2024-07-22 21:22:04 -03:00
|
|
|
--enable-slower-safety \
|
2024-01-01 20:16:53 -04:00
|
|
|
${{ inputs.free-threading && '--disable-gil' || '' }} \
|
2023-10-29 03:12:16 -03:00
|
|
|
--prefix=/opt/python-dev \
|
|
|
|
--with-openssl="$(brew --prefix openssl@3.0)"
|
|
|
|
- name: Build CPython
|
2024-05-06 19:08:17 -03:00
|
|
|
run: make -j8
|
2023-10-29 03:12:16 -03:00
|
|
|
- name: Display build info
|
|
|
|
run: make pythoninfo
|
|
|
|
- name: Tests
|
|
|
|
run: make test
|