Skip to content

Commit

Permalink
[3.12] Generalize reusable Windows CI jobs (python#121766)
Browse files Browse the repository at this point in the history
(cherry picked from commit 7982363)
  • Loading branch information
webknjaz committed Jul 16, 2024
1 parent 9d996b5 commit ca0183b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 36 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
59 changes: 25 additions & 34 deletions .github/workflows/reusable-windows.yml
Original file line number Diff line number Diff line change
@@ -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

jobs:
build_win32:
name: 'build and test (x86)'
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
env:
IncludeUwp: >-
true
build_win_amd64:
name: 'build and test (x64)'
jobs:
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: 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

0 comments on commit ca0183b

Please sign in to comment.