Skip to content

Commit

Permalink
pythongh-111062: Separate macOS build into a reusable workflow (pytho…
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaqq authored and FullteaR committed Nov 3, 2023
1 parent ab530e0 commit 05924a6
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 31 deletions.
34 changes: 3 additions & 31 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,39 +231,11 @@ jobs:

build_macos:
name: 'macOS'
runs-on: macos-latest
timeout-minutes: 60
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
env:
HOMEBREW_NO_ANALYTICS: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
PYTHONSTRICTEXTENSIONBUILD: 1
steps:
- uses: actions/checkout@v4
- name: Restore config.cache
uses: actions/cache@v3
with:
path: config.cache
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
- name: Install Homebrew dependencies
run: brew install pkg-config [email protected] 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 \
--prefix=/opt/python-dev \
--with-openssl="$(brew --prefix [email protected])"
- name: Build CPython
run: make -j4
- name: Display build info
run: make pythoninfo
- name: Tests
run: make test
uses: ./.github/workflows/reusable-build-macos.yml
with:
config_hash: ${{ needs.check_source.outputs.config_hash }}

build_ubuntu:
name: 'Ubuntu'
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/reusable-build-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
on:
workflow_call:
inputs:
config_hash:
required: true
type: string

jobs:
build_macos:
runs-on: macos-latest
timeout-minutes: 60
env:
HOMEBREW_NO_ANALYTICS: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
PYTHONSTRICTEXTENSIONBUILD: 1
steps:
- uses: actions/checkout@v4
- name: Restore config.cache
uses: actions/cache@v3
with:
path: config.cache
key: ${{ github.job }}-${{ runner.os }}-${{ inputs.config_hash }}
- name: Install Homebrew dependencies
run: brew install pkg-config [email protected] 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 \
--prefix=/opt/python-dev \
--with-openssl="$(brew --prefix [email protected])"
- name: Build CPython
run: make -j4
- name: Display build info
run: make pythoninfo
- name: Tests
run: make test

0 comments on commit 05924a6

Please sign in to comment.