mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-10 07:14:46 +03:00
use powershell
This commit is contained in:
parent
1cbfb84652
commit
fc5cd83ec0
12
.github/workflows/test-windows.yml
vendored
12
.github/workflows/test-windows.yml
vendored
|
@ -238,16 +238,8 @@ jobs:
|
||||||
- name: Test Wheel
|
- name: Test Wheel
|
||||||
if: "github.event_name != 'pull_request' && !contains(matrix.python-version, 'pypy')"
|
if: "github.event_name != 'pull_request' && !contains(matrix.python-version, 'pypy')"
|
||||||
run: |
|
run: |
|
||||||
cd C:\pillow
|
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 }}
|
||||||
python -m pip install pytest pytest-timeout
|
shell: pwsh
|
||||||
for %%f in (dist\*.whl) do python -m pip install %%f
|
|
||||||
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\python.exe" /v "GlobalFlag" /t REG_SZ /d "0x02000000" /f
|
|
||||||
path C:\pillow\winbuild\build\bin\;%PATH%
|
|
||||||
set CI=
|
|
||||||
python -m pytest -vx Tests\check_wheel.py Tests
|
|
||||||
shell: cmd /c copy {0} docker.bat && docker run --rm -v %GITHUB_WORKSPACE%:C:\pillow %DOCKER_IMAGE% C:\pillow\docker.bat
|
|
||||||
env:
|
|
||||||
DOCKER_IMAGE: winamd64/python:${{ matrix.python-version }}-windowsservercore
|
|
||||||
|
|
||||||
- name: Upload wheel
|
- name: Upload wheel
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
|
|
26
winbuild/test_docker.ps1
Normal file
26
winbuild/test_docker.ps1
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
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'
|
||||||
|
)
|
||||||
|
$env:CI = "true"
|
||||||
|
$env:path += ";C:\Python\;C:\pillow\winbuild\build\bin\"
|
||||||
|
cd C:\pillow
|
||||||
|
& python -VV
|
||||||
|
& python -m ensurepip
|
||||||
|
& python -m pip install pytest pytest-timeout
|
||||||
|
& python -m pip install "dist\$(Get-ChildItem dist\*.whl -Name)"
|
||||||
|
& python -m pytest -vx Tests\check_wheel.py Tests
|
||||||
|
if ((Test-Path -LiteralPath variable:\LASTEXITCODE)) { exit $LASTEXITCODE }
|
Loading…
Reference in New Issue
Block a user