2024-10-10 09:39:53 -03:00
|
|
|
name: Reusable macOS
|
|
|
|
|
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-07-25 17:27:26 -03:00
|
|
|
os:
|
|
|
|
description: OS to run the job
|
|
|
|
required: true
|
2024-03-14 12:10:56 -03:00
|
|
|
type: string
|
2023-10-29 03:12:16 -03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_macos:
|
2024-07-25 17:27:26 -03:00
|
|
|
name: build and test (${{ inputs.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-07-25 17:27:26 -03:00
|
|
|
runs-on: ${{ inputs.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-07-25 17:27:26 -03:00
|
|
|
key: ${{ github.job }}-${{ inputs.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
|
2023-10-29 03:12:16 -03:00
|
|
|
- name: Install Homebrew dependencies
|
2024-09-16 14:22:30 -03:00
|
|
|
run: brew install pkg-config openssl@3.0 xz gdbm tcl-tk make
|
2023-10-29 03:12:16 -03:00
|
|
|
- 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-09-16 14:22:30 -03:00
|
|
|
--enable-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-09-16 14:22:30 -03:00
|
|
|
if : ${{ inputs.free-threading || inputs.os != 'macos-13' }}
|
|
|
|
run: gmake -j8
|
|
|
|
- name: Build CPython for compiler warning check
|
|
|
|
if : ${{ !inputs.free-threading && inputs.os == 'macos-13' }}
|
|
|
|
run: set -o pipefail; gmake -j8 --output-sync 2>&1 | tee compiler_output_macos.txt
|
2023-10-29 03:12:16 -03:00
|
|
|
- name: Display build info
|
|
|
|
run: make pythoninfo
|
2024-08-06 14:26:37 -03:00
|
|
|
- name: Check compiler warnings
|
2024-09-16 14:22:30 -03:00
|
|
|
if : ${{ !inputs.free-threading && inputs.os == 'macos-13' }}
|
|
|
|
run: >-
|
|
|
|
python3 Tools/build/check_warnings.py
|
|
|
|
--compiler-output-file-path=compiler_output_macos.txt
|
|
|
|
--warning-ignore-file-path=Tools/build/.warningignore_macos
|
|
|
|
--compiler-output-type=clang
|
|
|
|
--fail-on-regression
|
|
|
|
--fail-on-improvement
|
|
|
|
--path-prefix="./"
|
2023-10-29 03:12:16 -03:00
|
|
|
- name: Tests
|
|
|
|
run: make test
|