Skip to content

Commit d8d6170

Browse files
committed
[3.12] Generalize reusable Windows CI jobs (python#121766)
(cherry picked from commit 7982363)
1 parent d870f41 commit d8d6170

File tree

2 files changed

+42
-36
lines changed

2 files changed

+42
-36
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,24 @@ jobs:
216216
run: make check-c-globals
217217

218218
build_windows:
219-
name: 'Windows'
219+
name: >-
220+
Windows
221+
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
220222
needs: check_source
221-
if: needs.check_source.outputs.run_tests == 'true'
223+
if: fromJSON(needs.check_source.outputs.run_tests)
224+
strategy:
225+
matrix:
226+
arch:
227+
- Win32
228+
- x64
229+
- arm64
230+
free-threading:
231+
- false
232+
# - true
222233
uses: ./.github/workflows/reusable-windows.yml
234+
with:
235+
arch: ${{ matrix.arch }}
236+
free-threading: ${{ matrix.free-threading }}
223237

224238
build_macos:
225239
name: 'macOS'
Lines changed: 26 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,45 @@
11
on:
22
workflow_call:
33
inputs:
4+
arch:
5+
description: CPU architecture
6+
required: true
7+
type: string
48
free-threading:
9+
description: Whether to use no-GIL mode
510
required: false
611
type: boolean
712
default: false
813

9-
jobs:
10-
build_win32:
11-
name: 'build and test (x86)'
12-
runs-on: windows-latest
13-
timeout-minutes: 60
14-
env:
15-
IncludeUwp: 'true'
16-
steps:
17-
- uses: actions/checkout@v4
18-
- name: Build CPython
19-
run: .\PCbuild\build.bat -e -d -p Win32 ${{ inputs.free-threading && '--disable-gil' || '' }}
20-
- name: Display build info
21-
run: .\python.bat -m test.pythoninfo
22-
- name: Tests
23-
run: .\PCbuild\rt.bat -p Win32 -d -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
14+
env:
15+
IncludeUwp: >-
16+
true
2417
25-
build_win_amd64:
26-
name: 'build and test (x64)'
18+
jobs:
19+
build:
20+
name: >-
21+
build${{ inputs.arch != 'arm64' && ' and test' || '' }}
22+
(${{ inputs.arch }})
2723
runs-on: windows-latest
2824
timeout-minutes: 60
29-
env:
30-
IncludeUwp: 'true'
3125
steps:
3226
- uses: actions/checkout@v4
3327
- name: Register MSVC problem matcher
28+
if: inputs.arch != 'Win32'
3429
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
3530
- name: Build CPython
36-
run: .\PCbuild\build.bat -e -d -p x64 ${{ inputs.free-threading && '--disable-gil' || '' }}
31+
run: >-
32+
.\PCbuild\build.bat
33+
-e -d
34+
-p ${{ inputs.arch }}
35+
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
3736
- name: Display build info
37+
if: inputs.arch != 'arm64'
3838
run: .\python.bat -m test.pythoninfo
3939
- name: Tests
40-
run: .\PCbuild\rt.bat -p x64 -d -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
41-
42-
build_win_arm64:
43-
name: 'build (arm64)'
44-
runs-on: windows-latest
45-
timeout-minutes: 60
46-
env:
47-
IncludeUwp: 'true'
48-
steps:
49-
- uses: actions/checkout@v4
50-
- name: Register MSVC problem matcher
51-
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
52-
- name: Build CPython
53-
run: .\PCbuild\build.bat -e -d -p arm64 ${{ inputs.free-threading && '--disable-gil' || '' }}
40+
if: inputs.arch != 'arm64'
41+
run: >-
42+
.\PCbuild\rt.bat
43+
-p ${{ inputs.arch }}
44+
-d -q -uall -u-cpu -rwW
45+
--slowest --timeout=1200 -j0

0 commit comments

Comments
 (0)