Skip to content

Commit 5cfe748

Browse files
corona10jota12xhugovk
authored andcommitted
pythongh-111062: Reusable Windows build that supports free-threaded mode as the conditional CI (python#111493)
* pythongh-111062 Set up free-threaded CI for windows Co-authored-by: Donghee Na <[email protected]> * Apply suggestions from code review Co-authored-by: Hugo van Kemenade <[email protected]> * Update * Update names * Add files * Update * Revert "Update" This reverts commit 4f17e1a. * fix --------- Co-authored-by: juanjose.tenorio <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]>
1 parent 217fcc7 commit 5cfe748

File tree

2 files changed

+63
-49
lines changed

2 files changed

+63
-49
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -178,56 +178,19 @@ jobs:
178178
if: github.event_name == 'pull_request' # $GITHUB_EVENT_NAME
179179
run: make check-c-globals
180180

181-
build_win32:
182-
name: 'Windows (x86)'
183-
runs-on: windows-latest
184-
timeout-minutes: 60
181+
build_windows:
182+
name: 'Windows'
185183
needs: check_source
186184
if: needs.check_source.outputs.run_tests == 'true'
187-
env:
188-
IncludeUwp: 'true'
189-
steps:
190-
- uses: actions/checkout@v4
191-
- name: Build CPython
192-
run: .\PCbuild\build.bat -e -d -p Win32
193-
- name: Display build info
194-
run: .\python.bat -m test.pythoninfo
195-
- name: Tests
196-
run: .\PCbuild\rt.bat -p Win32 -d -q --fast-ci
197-
198-
build_win_amd64:
199-
name: 'Windows (x64)'
200-
runs-on: windows-latest
201-
timeout-minutes: 60
202-
needs: check_source
203-
if: needs.check_source.outputs.run_tests == 'true'
204-
env:
205-
IncludeUwp: 'true'
206-
steps:
207-
- uses: actions/checkout@v4
208-
- name: Register MSVC problem matcher
209-
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
210-
- name: Build CPython
211-
run: .\PCbuild\build.bat -e -d -p x64
212-
- name: Display build info
213-
run: .\python.bat -m test.pythoninfo
214-
- name: Tests
215-
run: .\PCbuild\rt.bat -p x64 -d -q --fast-ci
185+
uses: ./.github/workflows/reusable-build-windows.yml
216186

217-
build_win_arm64:
218-
name: 'Windows (arm64)'
219-
runs-on: windows-latest
220-
timeout-minutes: 60
187+
build_windows_free_threaded:
188+
name: 'Windows (free-threaded)'
221189
needs: check_source
222-
if: needs.check_source.outputs.run_tests == 'true'
223-
env:
224-
IncludeUwp: 'true'
225-
steps:
226-
- uses: actions/checkout@v4
227-
- name: Register MSVC problem matcher
228-
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
229-
- name: Build CPython
230-
run: .\PCbuild\build.bat -e -d -p arm64
190+
if: needs.check_source.outputs.run_tests == 'true' && contains(github.event.pull_request.labels.*.name, 'topic-free-threaded')
191+
uses: ./.github/workflows/reusable-build-windows.yml
192+
with:
193+
free-threaded: true
231194

232195
build_macos:
233196
name: 'macOS'
@@ -537,9 +500,7 @@ jobs:
537500
- check_source # Transitive dependency, needed to access `run_tests` value
538501
- check-docs
539502
- check_generated_files
540-
- build_win32
541-
- build_win_amd64
542-
- build_win_arm64
503+
- build_windows
543504
- build_macos
544505
- build_ubuntu
545506
- build_ubuntu_free_threaded
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
free-threaded:
5+
required: false
6+
type: boolean
7+
default: false
8+
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-threaded && '--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 --fast-ci
24+
25+
build_win_amd64:
26+
name: 'build and test (x64)'
27+
runs-on: windows-latest
28+
timeout-minutes: 60
29+
env:
30+
IncludeUwp: 'true'
31+
steps:
32+
- uses: actions/checkout@v4
33+
- name: Register MSVC problem matcher
34+
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
35+
- name: Build CPython
36+
run: .\PCbuild\build.bat -e -d -p x64 ${{ inputs.free-threaded && '--disable-gil' || '' }}
37+
- name: Display build info
38+
run: .\python.bat -m test.pythoninfo
39+
- name: Tests
40+
run: .\PCbuild\rt.bat -p x64 -d -q --fast-ci
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-threaded && '--disable-gil' || '' }}

0 commit comments

Comments
 (0)