mirror of
https://github.com/actions/python-versions.git
synced 2025-12-15 15:32:11 +00:00
Compare commits
2 Commits
fix-macos-
...
arm64win-t
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42cf8bab67 | ||
|
|
d3b7d73238 |
104
.github/workflows/build-python-packages.yml
vendored
104
.github/workflows/build-python-packages.yml
vendored
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
name: Build Python package
|
name: Build Python package
|
||||||
run-name: Generate Python ${{ inputs.VERSION || '3.12.3' }}
|
run-name: Generate Python ${{ inputs.VERSION || '3.12.3' }}
|
||||||
on:
|
on:
|
||||||
@@ -15,7 +16,7 @@ on:
|
|||||||
PLATFORMS:
|
PLATFORMS:
|
||||||
description: 'Platforms for execution in "os" or "os_arch" format (arch is "x64" by default)'
|
description: 'Platforms for execution in "os" or "os_arch" format (arch is "x64" by default)'
|
||||||
required: true
|
required: true
|
||||||
default: 'ubuntu-20.04,ubuntu-22.04,ubuntu-22.04_arm64,ubuntu-24.04,ubuntu-24.04_arm64,macos-12_x64,macos-14_arm64,windows-2019_x64,windows-2019_x86,windows-2019_arm64'
|
default: 'ubuntu-20.04,ubuntu-20.04_arm64,ubuntu-22.04,ubuntu-22.04_arm64,ubuntu-24.04,ubuntu-24.04_arm64,macos-11_x64,macos-14_arm64,windows-2019_x64,windows-2019_x86,windows-2019_arm64'
|
||||||
pull_request:
|
pull_request:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'versions-manifest.json'
|
- 'versions-manifest.json'
|
||||||
@@ -39,33 +40,29 @@ jobs:
|
|||||||
- name: Generate execution matrix
|
- name: Generate execution matrix
|
||||||
id: generate-matrix
|
id: generate-matrix
|
||||||
run: |
|
run: |
|
||||||
[String[]]$configurations = "${{ inputs.platforms || 'ubuntu-20.04,ubuntu-22.04,ubuntu-22.04_arm64,ubuntu-24.04,ubuntu-24.04_arm64,macos-12,macos-14_arm64,windows-2019_x64,windows-2019_x86,windows-2019_arm64' }}".Split(",").Trim()
|
[String[]]$configurations = "${{ inputs.platforms || 'ubuntu-20.04,ubuntu-20.04_arm64,ubuntu-22.04,ubuntu-22.04_arm64,ubuntu-24.04,ubuntu-24.04_arm64,macos-11,macos-14_arm64,windows-2019_x64,windows-2019_x86,windows-2019_arm64' }}".Split(",").Trim()
|
||||||
$matrix = @()
|
$matrix = @()
|
||||||
|
|
||||||
foreach ($configuration in $configurations) {
|
foreach ($configuration in $configurations) {
|
||||||
$parts = $configuration.Split("_")
|
$parts = $configuration.Split("_")
|
||||||
$os = $parts[0]
|
$os = $parts[0]
|
||||||
$arch = if ($parts[1]) {$parts[1]} else {"x64"}
|
$arch = if ($parts[1]) {$parts[1]} else {"x64"}
|
||||||
|
|
||||||
switch -wildcard ($os) {
|
switch -wildcard ($os) {
|
||||||
"*ubuntu*" { $platform = $os.Replace("ubuntu","linux")}
|
"*ubuntu*" { $platform = $os.Replace("ubuntu","linux")}
|
||||||
"*macos*" { $platform = 'darwin' }
|
"*macos*" { $platform = 'darwin' }
|
||||||
"*windows*" { $platform = 'win32' }
|
"*windows*" { $platform = 'win32' }
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($configuration -eq "ubuntu-22.04_arm64") {
|
if ($configuration -eq "windows-2019_arm64") {
|
||||||
$os = "setup-actions-ubuntu-arm64-2-core"
|
|
||||||
}
|
|
||||||
elseif ($configuration -eq "ubuntu-24.04_arm64") {
|
|
||||||
$os = "setup-actions-ubuntu24-arm64-2-core"
|
|
||||||
}
|
|
||||||
elseif ($configuration -eq "windows-2019_arm64") {
|
|
||||||
$os = "setup-actions-windows-arm64-4-core"
|
$os = "setup-actions-windows-arm64-4-core"
|
||||||
}
|
}
|
||||||
|
|
||||||
$matrix += @{
|
$matrix += @{
|
||||||
'platform' = $platform
|
'platform' = $platform
|
||||||
'os' = $os
|
'os' = $os
|
||||||
'arch' = $arch
|
'arch' = $arch
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo "matrix=$($matrix | ConvertTo-Json -Compress -AsArray)" >> $env:GITHUB_OUTPUT
|
echo "matrix=$($matrix | ConvertTo-Json -Compress -AsArray)" >> $env:GITHUB_OUTPUT
|
||||||
@@ -80,40 +77,39 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
ARTIFACT_NAME: python-${{ inputs.VERSION || '3.12.3' }}-${{ matrix.platform }}-${{ matrix.arch }}
|
ARTIFACT_NAME: python-${{ inputs.VERSION || '3.12.3' }}-${{ matrix.platform }}-${{ matrix.arch }}
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Setup Environment on Windows ARM64 Runner
|
- name: Setup Environment on Windows ARM64 Runner
|
||||||
if: matrix.os == 'setup-actions-windows-arm64-4-core'
|
if: matrix.os == 'setup-actions-windows-arm64-4-core'
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
# Install Chocolatey
|
# Install Chocolatey
|
||||||
Set-ExecutionPolicy Bypass -Scope Process -Force
|
Set-ExecutionPolicy Bypass -Scope Process -Force
|
||||||
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
|
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
|
||||||
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
|
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
|
||||||
echo "C:\ProgramData\Chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
|
echo "C:\ProgramData\Chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
|
||||||
|
|
||||||
# Install PowerShell
|
# Install PowerShell
|
||||||
choco install powershell-core -y
|
choco install powershell-core -y
|
||||||
echo "C:\Program Files\PowerShell\7" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
|
echo "C:\Program Files\PowerShell\7" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
|
||||||
|
|
||||||
# Install Git
|
# Install Git
|
||||||
choco install git -y
|
choco install git -y
|
||||||
echo "C:\Program Files\Git\cmd" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
|
echo "C:\Program Files\Git\cmd" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
|
||||||
|
|
||||||
|
|
||||||
# Install 7-Zip
|
# Install 7-Zip
|
||||||
choco install 7zip -y
|
choco install 7zip -y
|
||||||
echo "C:\ProgramData\chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
|
echo "C:\ProgramData\chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
|
||||||
|
|
||||||
|
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
|
|
||||||
- name: Build Python ${{ env.VERSION }}
|
- name: Build Python ${{ env.VERSION }}
|
||||||
run: |
|
run: |
|
||||||
./builders/build-python.ps1 -Version $env:VERSION `
|
./builders/build-python.ps1 -Version $env:VERSION `
|
||||||
-Platform ${{ matrix.platform }} -Architecture ${{ matrix.arch }}
|
-Platform ${{ matrix.platform }} -Architecture ${{ matrix.arch }}
|
||||||
|
|
||||||
- name: Publish artifact
|
- name: Publish artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
@@ -131,29 +127,30 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
ARTIFACT_NAME: python-${{ inputs.VERSION || '3.12.3' }}-${{ matrix.platform }}-${{ matrix.arch }}
|
ARTIFACT_NAME: python-${{ inputs.VERSION || '3.12.3' }}-${{ matrix.platform }}-${{ matrix.arch }}
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Setup Environment on Windows ARM64 Runner
|
- name: Setup Environment on Windows ARM64 Runner
|
||||||
if: matrix.os == 'setup-actions-windows-arm64-4-core'
|
if: matrix.os == 'setup-actions-windows-arm64-4-core'
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
# Install Chocolatey
|
# Install Chocolatey
|
||||||
Set-ExecutionPolicy Bypass -Scope Process -Force
|
Set-ExecutionPolicy Bypass -Scope Process -Force
|
||||||
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
|
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
|
||||||
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
|
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
|
||||||
echo "C:\ProgramData\Chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
|
echo "C:\ProgramData\Chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
|
||||||
|
|
||||||
# Install PowerShell
|
# Install PowerShell
|
||||||
choco install powershell-core -y
|
choco install powershell-core -y
|
||||||
echo "C:\Program Files\PowerShell\7" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
|
echo "C:\Program Files\PowerShell\7" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
|
||||||
|
|
||||||
# Install Git
|
# Install Git
|
||||||
choco install git -y
|
choco install git -y
|
||||||
echo "C:\Program Files\Git\cmd" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
|
echo "C:\Program Files\Git\cmd" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
|
||||||
|
|
||||||
|
|
||||||
# Install 7-Zip
|
# Install 7-Zip
|
||||||
choco install 7zip -y
|
choco install 7zip -y
|
||||||
echo "C:\ProgramData\chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
|
echo "C:\ProgramData\chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
|
||||||
|
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@@ -173,6 +170,7 @@ jobs:
|
|||||||
name: ${{ env.ARTIFACT_NAME }}
|
name: ${{ env.ARTIFACT_NAME }}
|
||||||
path: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }}
|
path: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }}
|
||||||
|
|
||||||
|
|
||||||
- name: Extract files
|
- name: Extract files
|
||||||
run: |
|
run: |
|
||||||
if ('${{ matrix.platform }}' -eq 'win32') {
|
if ('${{ matrix.platform }}' -eq 'win32') {
|
||||||
@@ -211,7 +209,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
$pythonLocation = which python
|
$pythonLocation = which python
|
||||||
if ('${{ matrix.platform }}' -eq 'darwin') { otool -L $pythonLocation } else { ldd $pythonLocation }
|
if ('${{ matrix.platform }}' -eq 'darwin') { otool -L $pythonLocation } else { ldd $pythonLocation }
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
Install-Module Pester -Force -Scope CurrentUser -SkipPublisherCheck
|
Install-Module Pester -Force -Scope CurrentUser -SkipPublisherCheck
|
||||||
@@ -246,7 +243,6 @@ jobs:
|
|||||||
release_name: ${{ env.VERSION }}
|
release_name: ${{ env.VERSION }}
|
||||||
body: |
|
body: |
|
||||||
Python ${{ env.VERSION }}
|
Python ${{ env.VERSION }}
|
||||||
|
|
||||||
- name: Generate hash for packages
|
- name: Generate hash for packages
|
||||||
run: |
|
run: |
|
||||||
$childItems = Get-Childitem -Path '.'
|
$childItems = Get-Childitem -Path '.'
|
||||||
|
|||||||
3
.github/workflows/codeql-analysis.yml
vendored
3
.github/workflows/codeql-analysis.yml
vendored
@@ -13,5 +13,4 @@ jobs:
|
|||||||
name: CodeQL analysis
|
name: CodeQL analysis
|
||||||
uses: actions/reusable-workflows/.github/workflows/codeql-analysis.yml@main
|
uses: actions/reusable-workflows/.github/workflows/codeql-analysis.yml@main
|
||||||
with:
|
with:
|
||||||
languages: '["python"]'
|
languages: "['python']"
|
||||||
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
using module "./python-builder.psm1"
|
using module "./python-builder.psm1"
|
||||||
|
|
||||||
class WinPythonBuilder : PythonBuilder {
|
class WinPythonBuilder : PythonBuilder {
|
||||||
@@ -64,6 +65,7 @@ class WinPythonBuilder : PythonBuilder {
|
|||||||
$ArchitectureExtension = "-arm64"
|
$ArchitectureExtension = "-arm64"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return $ArchitectureExtension
|
return $ArchitectureExtension
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,35 +13,29 @@ Import-Module (Join-Path $PSScriptRoot "../builders/python-version.psm1")
|
|||||||
|
|
||||||
BeforeAll {
|
BeforeAll {
|
||||||
function Analyze-MissingModules([string] $buildOutputLocation) {
|
function Analyze-MissingModules([string] $buildOutputLocation) {
|
||||||
$searchStringStart = "Failed to build these modules:"
|
$searchStringStart = "Failed to build these modules:"
|
||||||
$searchStringEnd = "running build_scripts"
|
$searchStringEnd = "running build_scripts"
|
||||||
$pattern = "$searchStringStart(.*?)$searchStringEnd"
|
$pattern = "$searchStringStart(.*?)$searchStringEnd"
|
||||||
|
|
||||||
$buildContent = Get-Content -Path $buildOutputLocation
|
$buildContent = Get-Content -Path $buildOutputLocation
|
||||||
$splitBuiltOutput = $buildContent -split "\n"
|
$splitBuiltOutput = $buildContent -split "\n";
|
||||||
|
|
||||||
### Search for missing modules that are displayed between the search strings
|
### Search for missing modules that are displayed between the search strings
|
||||||
$regexMatch = [regex]::match($splitBuiltOutput, $pattern)
|
$regexMatch = [regex]::match($SplitBuiltOutput, $Pattern)
|
||||||
if ($regexMatch.Success) {
|
if ($regexMatch.Success)
|
||||||
$module = $regexMatch.Groups[1].Value.Trim()
|
{
|
||||||
Write-Host "Failed missing modules:"
|
$module = $regexMatch.Groups[1].Value.Trim()
|
||||||
Write-Host $module
|
Write-Host "Failed missing modules:"
|
||||||
try {
|
Write-Host $module
|
||||||
$semver = [semver]"$($Version.Major).$($Version.Minor)"
|
if ( ($module -eq "_tkinter") -and ( [semver]"$($Version.Major).$($Version.Minor)" -ge [semver]"3.10" -and $Version.PreReleaseLabel ) ) {
|
||||||
} catch {
|
Write-Host "$module $Version ignored"
|
||||||
Write-Error "Invalid Semantic Version format: $Version"
|
} else {
|
||||||
return 1
|
return 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($module -eq "_tkinter") -and ($semver -ge [semver]"3.8")) {
|
return 0
|
||||||
Write-Host "$module $Version ignored"
|
|
||||||
} else {
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Describe "Tests" {
|
Describe "Tests" {
|
||||||
@@ -60,7 +54,7 @@ Describe "Tests" {
|
|||||||
# linux has no display name and no $DISPLAY environment variable - skip tk test
|
# linux has no display name and no $DISPLAY environment variable - skip tk test
|
||||||
# if (-not (($Platform -match "ubuntu") -or ($Platform -match "linux"))) {
|
# if (-not (($Platform -match "ubuntu") -or ($Platform -match "linux"))) {
|
||||||
# It "Check if tcl/tk has the same headed and library versions" {
|
# It "Check if tcl/tk has the same headed and library versions" {
|
||||||
# "python ./sources/tcltk.py" | Should -ReturnZeroExitCode
|
# "python ./sources/tcltk.py" | Should -ReturnZeroExitCode
|
||||||
# }
|
# }
|
||||||
# }
|
# }
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user