|
12 | 12 | required: true |
13 | 13 | type: boolean |
14 | 14 | default: false |
| 15 | + THREADING_BUILD_MODES: |
| 16 | + description: 'CPython threading build modes' |
| 17 | + required: true |
| 18 | + type: string |
| 19 | + default: 'default,freethreaded' |
15 | 20 | PLATFORMS: |
16 | 21 | description: 'Platforms for execution in "os" or "os_arch" format (arch is "x64" by default)' |
17 | 22 | required: true |
@@ -40,32 +45,42 @@ jobs: |
40 | 45 | id: generate-matrix |
41 | 46 | run: | |
42 | 47 | [String[]]$configurations = "${{ inputs.platforms || 'ubuntu-20.04,ubuntu-22.04,ubuntu-22.04_arm64,ubuntu-24.04,ubuntu-24.04_arm64,macos-13,macos-14_arm64,windows-2019_x64,windows-2019_x86,windows-2019_arm64' }}".Split(",").Trim() |
| 48 | + [String[]]$buildModes = "${{ inputs.threading_build_modes || 'default' }}".Split(",").Trim() |
43 | 49 | $matrix = @() |
44 | 50 | |
45 | 51 | foreach ($configuration in $configurations) { |
46 | | - $parts = $configuration.Split("_") |
47 | | - $os = $parts[0] |
48 | | - $arch = if ($parts[1]) {$parts[1]} else {"x64"} |
49 | | - switch -wildcard ($os) { |
50 | | - "*ubuntu*" { $platform = $os.Replace("ubuntu","linux")} |
51 | | - "*macos*" { $platform = 'darwin' } |
52 | | - "*windows*" { $platform = 'win32' } |
53 | | - } |
54 | | - |
55 | | - if ($configuration -eq "ubuntu-22.04_arm64") { |
56 | | - $os = "setup-actions-ubuntu-arm64-2-core" |
57 | | - } |
58 | | - elseif ($configuration -eq "ubuntu-24.04_arm64") { |
59 | | - $os = "setup-actions-ubuntu24-arm64-2-core" |
60 | | - } |
61 | | - elseif ($configuration -eq "windows-2019_arm64") { |
62 | | - $os = "setup-actions-windows-arm64-4-core" |
63 | | - } |
64 | | - |
65 | | - $matrix += @{ |
66 | | - 'platform' = $platform |
67 | | - 'os' = $os |
68 | | - 'arch' = $arch |
| 52 | + foreach ($buildMode in $buildModes) { |
| 53 | + $parts = $configuration.Split("_") |
| 54 | + $os = $parts[0] |
| 55 | + $arch = if ($parts[1]) {$parts[1]} else {"x64"} |
| 56 | + switch -wildcard ($os) { |
| 57 | + "*ubuntu*" { $platform = $os.Replace("ubuntu","linux")} |
| 58 | + "*macos*" { $platform = 'darwin' } |
| 59 | + "*windows*" { $platform = 'win32' } |
| 60 | + } |
| 61 | +
|
| 62 | + if ($configuration -eq "ubuntu-22.04_arm64") { |
| 63 | + $os = "setup-actions-ubuntu-arm64-2-core" |
| 64 | + } |
| 65 | + elseif ($configuration -eq "ubuntu-24.04_arm64") { |
| 66 | + $os = "setup-actions-ubuntu24-arm64-2-core" |
| 67 | + } |
| 68 | + elseif ($configuration -eq "windows-2019_arm64") { |
| 69 | + $os = "setup-actions-windows-arm64-4-core" |
| 70 | + } |
| 71 | +
|
| 72 | + if ($buildMode -eq "freethreaded") { |
| 73 | + if ([semver]"${{ inputs.VERSION }}" -lt [semver]"3.13.0") { |
| 74 | + continue; |
| 75 | + } |
| 76 | + $arch += "-freethreaded" |
| 77 | + } |
| 78 | +
|
| 79 | + $matrix += @{ |
| 80 | + 'platform' = $platform |
| 81 | + 'os' = $os |
| 82 | + 'arch' = $arch |
| 83 | + } |
69 | 84 | } |
70 | 85 | } |
71 | 86 | echo "matrix=$($matrix | ConvertTo-Json -Compress -AsArray)" >> $env:GITHUB_OUTPUT |
@@ -205,6 +220,9 @@ jobs: |
205 | 220 | python-version: ${{ env.VERSION }} |
206 | 221 | architecture: ${{ matrix.arch }} |
207 | 222 |
|
| 223 | + - name: Python version |
| 224 | + run: python -VVV |
| 225 | + |
208 | 226 | - name: Verbose sysconfig dump |
209 | 227 | if: runner.os == 'Linux' || runner.os == 'macOS' |
210 | 228 | run: python ./sources/python-config-output.py |
|
0 commit comments