Skip to content

Commit 6e9b3f7

Browse files
authored
[3.12] Generalize reusable Windows CI jobs (#121766) (#121776)
1 parent 6586b17 commit 6e9b3f7

File tree

2 files changed

+41
-36
lines changed

2 files changed

+41
-36
lines changed

.github/workflows/build.yml

+16-2
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,24 @@ jobs:
236236
run: make check-c-globals
237237

238238
build_windows:
239-
name: 'Windows'
239+
name: >-
240+
Windows
241+
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
240242
needs: check_source
241-
if: needs.check_source.outputs.run_tests == 'true'
243+
if: fromJSON(needs.check_source.outputs.run_tests)
244+
strategy:
245+
matrix:
246+
arch:
247+
- Win32
248+
- x64
249+
- arm64
250+
free-threading:
251+
- false
252+
# - true
242253
uses: ./.github/workflows/reusable-windows.yml
254+
with:
255+
arch: ${{ matrix.arch }}
256+
free-threading: ${{ matrix.free-threading }}
243257

244258
build_macos:
245259
name: 'macOS'
+25-34
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,45 @@
11
on:
22
workflow_call:
33
inputs:
4+
arch:
5+
description: CPU architecture
6+
required: true
7+
type: string
48
free-threading:
59
description: Whether to compile CPython in free-threading mode
610
required: false
711
type: boolean
812
default: false
913

10-
jobs:
11-
build_win32:
12-
name: 'build and test (x86)'
13-
runs-on: windows-latest
14-
timeout-minutes: 60
15-
env:
16-
IncludeUwp: 'true'
17-
steps:
18-
- uses: actions/checkout@v4
19-
- name: Build CPython
20-
run: .\PCbuild\build.bat -e -d -p Win32 ${{ inputs.free-threading && '--disable-gil' || '' }}
21-
- name: Display build info
22-
run: .\python.bat -m test.pythoninfo
23-
- name: Tests
24-
run: .\PCbuild\rt.bat -p Win32 -d -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
14+
env:
15+
IncludeUwp: >-
16+
true
2517
26-
build_win_amd64:
27-
name: 'build and test (x64)'
18+
jobs:
19+
build:
20+
name: >-
21+
build${{ inputs.arch != 'arm64' && ' and test' || '' }}
22+
(${{ inputs.arch }})
2823
runs-on: windows-latest
2924
timeout-minutes: 60
30-
env:
31-
IncludeUwp: 'true'
3225
steps:
3326
- uses: actions/checkout@v4
3427
- name: Register MSVC problem matcher
28+
if: inputs.arch != 'Win32'
3529
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
3630
- name: Build CPython
37-
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' || '' }}
3836
- name: Display build info
37+
if: inputs.arch != 'arm64'
3938
run: .\python.bat -m test.pythoninfo
4039
- name: Tests
41-
run: .\PCbuild\rt.bat -p x64 -d -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
42-
43-
build_win_arm64:
44-
name: 'build (arm64)'
45-
runs-on: windows-latest
46-
timeout-minutes: 60
47-
env:
48-
IncludeUwp: 'true'
49-
steps:
50-
- uses: actions/checkout@v4
51-
- name: Register MSVC problem matcher
52-
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
53-
- name: Build CPython
54-
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)