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
|
2023-10-29 03:12:16 -03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_macos:
|
2023-10-30 12:15:22 -03:00
|
|
|
name: 'build and test'
|
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
|
|
|
|
PYTHONSTRICTEXTENSIONBUILD: 1
|
2024-01-31 21:35:48 -04:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [
|
|
|
|
"macos-14", # M1
|
|
|
|
"macos-13", # Intel
|
|
|
|
]
|
|
|
|
runs-on: ${{ matrix.os }}
|
2023-10-29 03:12:16 -03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- 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-01-31 21:35:48 -04:00
|
|
|
key: ${{ github.job }}-${{ matrix.os }}-${{ 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-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
|
|
|
|
run: make -j4
|
|
|
|
- name: Display build info
|
|
|
|
run: make pythoninfo
|
|
|
|
- name: Tests
|
|
|
|
run: make test
|