| 1 |
name: macos_build |
| 2 |
on: [pull_request, push] |
| 3 |
|
| 4 |
permissions: |
| 5 |
contents: read # to fetch code (actions/checkout) |
| 6 |
|
| 7 |
jobs: |
| 8 |
macos_build: |
| 9 |
strategy: |
| 10 |
fail-fast: false |
| 11 |
matrix: |
| 12 |
python-version: |
| 13 |
- "3.10" |
| 14 |
- "3.11" |
| 15 |
- "3.12" |
| 16 |
- "3.13" |
| 17 |
- "3.14" |
| 18 |
runs-on: macos-latest |
| 19 |
steps: |
| 20 |
- uses: actions/checkout@v6 |
| 21 |
- run: | |
| 22 |
brew install openssl readline sqlite3 xz tcl-tk@8 libb2 zstd |
| 23 |
- run: | |
| 24 |
#envvars |
| 25 |
export PYENV_ROOT="$GITHUB_WORKSPACE" |
| 26 |
echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV |
| 27 |
echo "$PYENV_ROOT/shims:$PYENV_ROOT/bin" >> $GITHUB_PATH |
| 28 |
- run: | |
| 29 |
#build |
| 30 |
pyenv --debug install ${{ matrix.python-version }} && rc=$? || rc=$? |
| 31 |
if [[ $rc -ne 0 ]]; then echo config.log:; cat $TMPDIR/python-build*/*/config.log; false; fi |
| 32 |
pyenv global ${{ matrix.python-version }} |
| 33 |
- run: | |
| 34 |
#print version |
| 35 |
python --version |
| 36 |
python -m pip --version |
| 37 |
- shell: python # Prove that actual Python == expected Python |
| 38 |
env: |
| 39 |
EXPECTED_PYTHON: ${{ matrix.python-version }} |
| 40 |
run: import os, sys ; assert sys.version.startswith(os.getenv("EXPECTED_PYTHON")) |