8000 🧪💅 Mv reusable-windows arch matrix outside · python/cpython@a66b4a0 · GitHub
[go: up one dir, main page]

Skip to content

Commit a66b4a0

Browse files
committed
🧪💅 Mv reusable-windows arch matrix outside
Previously, the reusable windows workflow defined a number of per-arch jobs with a lot of copy-paste. Now, there is a single job and a matrix definition on the calling side.
1 parent 4579407 commit a66b4a0

File tree

2 files changed

+36
-28
lines changed

2 files changed

+36
-28
lines changed

‎.github/workflows/build.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,29 @@ jobs:
182182
name: 'Windows'
183183
needs: check_source
184184
if: fromJSON(needs.check_source.outputs.run_tests)
185+
strategy:
186+
matrix:
187+
arch:
188+
- Win32
189+
- x64
190+
- arm64
185191
uses: ./.github/workflows/reusable-windows.yml
192+
with:
193+
arch: ${{ matrix.arch }}
186194

187195
build_windows_free_threading:
188196
name: 'Windows (free-threading)'
189197
needs: check_source
190198
if: fromJSON(needs.check_source.outputs.run_tests)
199+
strategy:
200+
matrix:
201+
arch:
202+
- Win32
203+
- x64
204+
- arm64
191205
uses: ./.github/workflows/reusable-windows.yml
192206
with:
207+
arch: ${{ matrix.arch }}
193208
free-threading: true
194209

195210
build_macos:
Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
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 use no-GIL mode
610
required: false
@@ -12,41 +16,30 @@ env:
1216
true
1317
1418
jobs:
15-
build_win32:
16-
name: 'build and test (x86)'
17-
runs-on: windows-latest
18-
timeout-minutes: 60
19-
steps:
20-
- uses: actions/checkout@v4
21-
- name: Build CPython
22-
run: .\PCbuild\build.bat -e -d -v -p Win32 ${{ fromJSON(inputs.free-threading) && '--disable-gil' | 10000 | '' }}
23-
- name: Display build info
24-
run: .\python.bat -m test.pythoninfo
25-
- name: Tests
26-
run: .\PCbuild\rt.bat -p Win32 -d -q --fast-ci ${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
27-
28-
build_win_amd64:
29-
name: 'build and test (x64)'
19+
build:
20+
name: >-
21+
build${{ inputs.arch != 'arm64' && ' and test' || '' }}
22+
(${{ inputs.arch }})
3023
runs-on: windows-latest
3124
timeout-minutes: 60
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 -v -p x64 ${{ fromJSON(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' || '' }}
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 --fast-ci ${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
42-
43-
build_win_arm64:
44-
name: 'build (arm64)'
45-
runs-on: windows-latest
46-
timeout-minutes: 60
47-
steps:
48-
- uses: actions/checkout@v4
49-
- name: Register MSVC problem matcher
50-
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
51-
- name: Build CPython
52-
run: .\PCbuild\build.bat -e -d -v -p arm64 ${{ fromJSON(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)
0