Skip to content

Commit 3ac9851

Browse files
authored
gh-111062: Separate macOS build into a reusable workflow (gh-111444)
1 parent 8c47ada commit 3ac9851

File tree

2 files changed

+43
-31
lines changed

2 files changed

+43
-31
lines changed

.github/workflows/build.yml

+3-31
Original file line numberDiff line numberDiff line change
@@ -231,39 +231,11 @@ jobs:
231231

232232
build_macos:
233233
name: 'macOS'
234-
runs-on: macos-latest
235-
timeout-minutes: 60
236234
needs: check_source
237235
if: needs.check_source.outputs.run_tests == 'true'
238-
env:
239-
HOMEBREW_NO_ANALYTICS: 1
240-
HOMEBREW_NO_AUTO_UPDATE: 1
241-
HOMEBREW_NO_INSTALL_CLEANUP: 1
242-
PYTHONSTRICTEXTENSIONBUILD: 1
243-
steps:
244-
- uses: actions/checkout@v4
245-
- name: Restore config.cache
246-
uses: actions/cache@v3
247-
with:
248-
path: config.cache
249-
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
250-
- name: Install Homebrew dependencies
251-
run: brew install pkg-config [email protected] xz gdbm tcl-tk
252-
- name: Configure CPython
253-
run: |
254-
GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
255-
GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
256-
./configure \
257-
--config-cache \
258-
--with-pydebug \
259-
--prefix=/opt/python-dev \
260-
--with-openssl="$(brew --prefix [email protected])"
261-
- name: Build CPython
262-
run: make -j4
263-
- name: Display build info
264-
run: make pythoninfo
265-
- name: Tests
266-
run: make test
236+
uses: ./.github/workflows/reusable-build-macos.yml
237+
with:
238+
config_hash: ${{ needs.check_source.outputs.config_hash }}
267239

268240
build_ubuntu:
269241
name: 'Ubuntu'
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
config_hash:
5+
required: true
6+
type: string
7+
8+
jobs:
9+
build_macos:
10+
runs-on: macos-latest
11+
timeout-minutes: 60
12+
env:
13+
HOMEBREW_NO_ANALYTICS: 1
14+
HOMEBREW_NO_AUTO_UPDATE: 1
15+
HOMEBREW_NO_INSTALL_CLEANUP: 1
16+
PYTHONSTRICTEXTENSIONBUILD: 1
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Restore config.cache
20+
uses: actions/cache@v3
21+
with:
22+
path: config.cache
23+
key: ${{ github.job }}-${{ runner.os }}-${{ inputs.config_hash }}
24+
- name: Install Homebrew dependencies
25+
run: brew install pkg-config [email protected] xz gdbm tcl-tk
26+
- name: Configure CPython
27+
run: |
28+
GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
29+
GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
30+
./configure \
31+
--config-cache \
32+
--with-pydebug \
33+
--prefix=/opt/python-dev \
34+
--with-openssl="$(brew --prefix [email protected])"
35+
- name: Build CPython
36+
run: make -j4
37+
- name: Display build info
38+
run: make pythoninfo
39+
- name: Tests
40+
run: make test

0 commit comments

Comments
 (0)