diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index df4d29975..84786429b 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -236,9 +236,9 @@ jobs: shell: cmd - name: Test Wheel - if: "github.event_name != 'pull_request' && !contains(matrix.python-version, 'pypy')" + if: "github.event_name != 'pull_request'" run: | - docker run --rm -v ${env:GITHUB_WORKSPACE}:C:\pillow mcr.microsoft.com/windows/servercore:ltsc2022 powershell C:\pillow\winbuild\test_docker.ps1 ${{ matrix.python-version }}.0 ${{ matrix.architecture }} + docker run --rm -v ${env:GITHUB_WORKSPACE}:C:\pillow mcr.microsoft.com/windows/servercore:ltsc2022 powershell C:\pillow\winbuild\test_docker.ps1 ${{ matrix.python-version }} ${{ matrix.architecture }} shell: pwsh - name: Upload wheel diff --git a/winbuild/test_docker.ps1 b/winbuild/test_docker.ps1 index 1aa5c4b5b..922295553 100644 --- a/winbuild/test_docker.ps1 +++ b/winbuild/test_docker.ps1 @@ -1,20 +1,30 @@ param ([string]$python,[string]$arch) $ErrorActionPreference = 'Stop' $ProgressPreference = 'SilentlyContinue' -$suffix = if ($arch -eq "x64") {"-amd64"} else {""} -$url = 'https://www.python.org/ftp/python/{0}/python-{0}{1}.exe' -f ($python, $suffix) -[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 -Invoke-WebRequest -Uri $url -OutFile 'setup.exe' -Start-Process setup.exe -Wait -NoNewWindow -PassThru -ArgumentList @( - '/quiet', - 'InstallAllUsers=0', - 'TargetDir=C:\Python', - 'PrependPath=1', - 'Shortcuts=0', - 'Include_doc=0', - 'Include_pip=1', - 'Include_test=0' - ) +if ($python -like "pypy*") { + $url = 'https://downloads.python.org/pypy/{0}-v7.3.11-win64.zip' -f $python + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + Invoke-WebRequest -Uri 'https://aka.ms/vs/15/release/vc_redist.x64.exe' -OutFile 'vc_redist.x64.exe' + & C:\vc_redist.x64.exe /install /quiet /norestart + Invoke-WebRequest -Uri $url -OutFile 'pypy.zip' + tar -xf 'pypy.zip' + mv pypy*-win64 C:\Python +} else { + $suffix = if ($arch -eq "x64") {"-amd64"} else {""} + $url = 'https://www.python.org/ftp/python/{0}.0/python-{0}.0{1}.exe' -f ($python, $suffix) + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + Invoke-WebRequest -Uri $url -OutFile 'setup.exe' + Start-Process setup.exe -Wait -NoNewWindow -PassThru -ArgumentList @( + '/quiet', + 'InstallAllUsers=0', + 'TargetDir=C:\Python', + 'PrependPath=1', + 'Shortcuts=0', + 'Include_doc=0', + 'Include_pip=1', + 'Include_test=0' + ) +} $env:CI = "true" $env:path += ";C:\Python\;C:\pillow\winbuild\build\bin\" cd C:\pillow