[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 run: make check-c-globals
build_windows: build_windows:
name: 'Windows' name: >-
Windows
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
needs: check_source 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 uses: ./.github/workflows/reusable-windows.yml
with:
arch: ${{ matrix.arch }}
free-threading: ${{ matrix.free-threading }}
build_macos: build_macos:
name: 'macOS' name: 'macOS'

View file

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