[3.12] Generalize reusable Windows CI jobs (#121766) (#121776)

This commit is contained in:
Sviatoslav Sydorenko (Святослав Сидоренко) 2024-07-22 13:40:10 +02:00 committed by GitHub
parent 6586b171ea
commit 6e9b3f79fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 41 additions and 36 deletions

View file

@ -236,10 +236,24 @@ jobs:
run: make check-c-globals
build_windows:
name: 'Windows'
name: >-
Windows
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
if: fromJSON(needs.check_source.outputs.run_tests)
strategy:
matrix:
arch:
- Win32
- x64
- arm64
free-threading:
- false
# - true
uses: ./.github/workflows/reusable-windows.yml
with:
arch: ${{ matrix.arch }}
free-threading: ${{ matrix.free-threading }}
build_macos:
name: 'macOS'

View file

@ -1,54 +1,45 @@
on:
workflow_call:
inputs:
arch:
description: CPU architecture
required: true
type: string
free-threading:
description: Whether to compile CPython in free-threading mode
required: false
type: boolean
default: false
env:
IncludeUwp: >-
true
jobs:
build_win32:
name: 'build and test (x86)'
build:
name: >-
build${{ inputs.arch != 'arm64' && ' and test' || '' }}
(${{ inputs.arch }})
runs-on: windows-latest
timeout-minutes: 60
env:
IncludeUwp: 'true'
steps:
- uses: actions/checkout@v4
- name: Build CPython
run: .\PCbuild\build.bat -e -d -p Win32 ${{ inputs.free-threading && '--disable-gil' || '' }}
- name: Display build info
run: .\python.bat -m test.pythoninfo
- name: Tests
run: .\PCbuild\rt.bat -p Win32 -d -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
build_win_amd64:
name: 'build and test (x64)'
runs-on: windows-latest
timeout-minutes: 60
env:
IncludeUwp: 'true'
steps:
- uses: actions/checkout@v4
- name: Register MSVC problem matcher
if: inputs.arch != 'Win32'
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
- name: Build CPython
run: .\PCbuild\build.bat -e -d -p x64 ${{ inputs.free-threading && '--disable-gil' || '' }}
run: >-
.\PCbuild\build.bat
-e -d
-p ${{ inputs.arch }}
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
- name: Display build info
if: inputs.arch != 'arm64'
run: .\python.bat -m test.pythoninfo
- name: Tests
run: .\PCbuild\rt.bat -p x64 -d -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
build_win_arm64:
name: 'build (arm64)'
runs-on: windows-latest
timeout-minutes: 60
env:
IncludeUwp: 'true'
steps:
- uses: actions/checkout@v4
- name: Register MSVC problem matcher
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
- name: Build CPython
run: .\PCbuild\build.bat -e -d -p arm64 ${{ inputs.free-threading && '--disable-gil' || '' }}
if: inputs.arch != 'arm64'
run: >-
.\PCbuild\rt.bat
-p ${{ inputs.arch }}
-d -q -uall -u-cpu -rwW
--slowest --timeout=1200 -j0