Skip to content

Commit 7982363

Browse files
authored
Generalize reusable Windows CI jobs (#121766)
1 parent d005f2c commit 7982363

File tree

2 files changed

+41
-45
lines changed

2 files changed

+41
-45
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -179,18 +179,24 @@ jobs:
179179
run: make check-c-globals
180180

181181
build_windows:
182-
name: 'Windows'
182+
name: >-
183+
Windows
184+
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
183185
needs: check_source
184-
if: needs.check_source.outputs.run_tests == 'true'
185-
uses: ./.github/workflows/reusable-windows.yml
186-
187-
build_windows_free_threading:
188-
name: 'Windows (free-threading)'
189-
needs: check_source
190-
if: needs.check_source.outputs.run_tests == 'true'
186+
if: fromJSON(needs.check_source.outputs.run_tests)
187+
strategy:
188+
matrix:
189+
arch:
190+
- Win32
191+
- x64
192+
- arm64
193+
free-threading:
194+
- false
195+
- true
191196
uses: ./.github/workflows/reusable-windows.yml
192197
with:
193-
free-threading: true
198+
arch: ${{ matrix.arch }}
199+
free-threading: ${{ matrix.free-threading }}
194200

195201
build_macos:
196202
name: 'macOS'
@@ -556,7 +562,6 @@ jobs:
556562
- build_ubuntu_ssltests
557563
- build_wasi
558564
- build_windows
559-
- build_windows_free_threading
560565
- test_hypothesis
561566
- build_asan
562567
- build_tsan
@@ -592,7 +597,6 @@ jobs:
592597
build_ubuntu_ssltests,
593598
build_wasi,
594599
build_windows,
595-
build_windows_free_threading,
596600
build_asan,
597601
build_tsan,
598602
build_tsan_free_threading,
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 -v -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 --fast-ci ${{ inputs.free-threading && '--disable-gil' || '' }}
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 -v -p x64 ${{ inputs.free-threading && '--disable-gil' || '' }}
31+
run: >-
32+
.\PCbuild\build.bat
33+
-e -d -v
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 --fast-ci ${{ inputs.free-threading && '--disable-gil' || '' }}
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 -v -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 --fast-ci
45+
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy