Skip to content

Commit

Permalink
also test PyPy
Browse files Browse the repository at this point in the history
  • Loading branch information
nulano committed Jan 2, 2023
1 parent 2cc4d28 commit 2139aa8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,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
Expand Down
38 changes: 24 additions & 14 deletions winbuild/test_docker.ps1
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 2139aa8

Please sign in to comment.