Pillow/.github/workflows/test-windows.yml

157 lines
5.1 KiB
YAML
Raw Normal View History

2019-09-23 14:12:01 +03:00
name: Test Windows
on: [push, pull_request]
jobs:
build:
2019-11-03 00:01:26 +03:00
runs-on: windows-2019
2019-09-23 14:12:01 +03:00
strategy:
fail-fast: false
2019-09-23 14:12:01 +03:00
matrix:
2020-01-25 22:03:26 +03:00
python-version: ["3.5", "3.6", "3.7", "3.8", "pypy3"]
architecture: ["x86", "x64"]
include:
- architecture: "x86"
platform-vcvars: "x86"
platform-msbuild: "Win32"
- architecture: "x64"
platform-vcvars: "x86_amd64"
platform-msbuild: "x64"
exclude:
2020-01-25 22:03:26 +03:00
# PyPy does not support 64-bit on Windows
- python-version: "pypy3"
architecture: "x64"
timeout-minutes: 30
2019-10-14 23:22:21 +03:00
name: Python ${{ matrix.python-version }} ${{ matrix.architecture }}
2019-10-14 23:22:21 +03:00
2019-09-23 14:12:01 +03:00
steps:
2020-01-01 04:43:00 +03:00
- name: Checkout Pillow
uses: actions/checkout@v1
2020-01-01 04:43:00 +03:00
- name: Checkout cached dependencies
uses: actions/checkout@v1
2019-11-20 21:20:01 +03:00
with:
repository: python-pillow/pillow-depends
ref: master
2020-01-01 04:43:00 +03:00
- name: Cache pip
2019-11-17 14:51:42 +03:00
uses: actions/cache@v1
with:
path: ~\AppData\Local\pip\Cache
key:
2019-11-19 12:55:49 +03:00
${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.architecture }}-${{ hashFiles('**/.github/workflows/test-windows.yml') }}
2019-11-17 14:51:42 +03:00
restore-keys: |
2019-11-19 12:55:49 +03:00
${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.architecture }}-
2019-11-17 14:51:42 +03:00
${{ runner.os }}-${{ matrix.python-version }}-
# sets env: pythonLocation
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
2019-09-25 10:58:29 +03:00
2020-01-01 04:43:00 +03:00
- name: Print build system information
run: python .github/workflows/system-info.py
2019-11-20 15:00:59 +03:00
- name: pip install wheel pytest pytest-cov
2020-01-01 04:43:00 +03:00
run: python -m pip install wheel pytest pytest-cov
2019-10-14 23:22:21 +03:00
2019-12-31 22:57:17 +03:00
- name: Prepare dependencies
2019-09-23 14:47:45 +03:00
run: |
2019-11-20 22:45:30 +03:00
7z x ..\pillow-depends\nasm-2.14.02-win64.zip "-o$env:RUNNER_WORKSPACE\"
2019-09-27 11:18:32 +03:00
Write-Host "::add-path::$env:RUNNER_WORKSPACE\nasm-2.14.02"
2019-11-20 22:45:30 +03:00
..\pillow-depends\gs950w32.exe /S
2019-11-08 01:23:59 +03:00
Write-Host "::add-path::C:\Program Files (x86)\gs\gs9.50\bin"
2019-11-20 21:20:01 +03:00
xcopy /s ..\pillow-depends\test_images\* $env:GITHUB_WORKSPACE\tests\images\
2019-12-31 22:57:17 +03:00
2020-02-25 02:00:57 +03:00
& python.exe $env:GITHUB_WORKSPACE\winbuild\build_prepare.py -v --depends=$env:RUNNER_WORKSPACE\pillow-depends\ --python=$env:pythonLocation
2019-09-23 14:47:45 +03:00
shell: pwsh
2020-01-01 04:43:00 +03:00
- name: Build dependencies / libjpeg-turbo
run: "& winbuild\\build\\build_dep_libjpeg.cmd"
2019-09-23 14:47:45 +03:00
- name: Build dependencies / zlib
2020-01-01 04:43:00 +03:00
run: "& winbuild\\build\\build_dep_zlib.cmd"
- name: Build dependencies / LibTiff
2020-01-01 04:43:00 +03:00
run: "& winbuild\\build\\build_dep_libtiff.cmd"
2019-09-25 12:28:52 +03:00
- name: Build dependencies / WebP
2020-01-01 04:43:00 +03:00
run: "& winbuild\\build\\build_dep_libwebp.cmd"
2019-09-25 12:28:52 +03:00
- name: Build dependencies / FreeType
2020-01-01 04:43:00 +03:00
run: "& winbuild\\build\\build_dep_freetype.cmd"
2019-09-25 12:28:52 +03:00
- name: Build dependencies / LCMS2
2020-01-01 04:43:00 +03:00
run: "& winbuild\\build\\build_dep_lcms2.cmd"
2019-09-25 12:28:52 +03:00
- name: Build dependencies / OpenJPEG
2020-01-01 04:43:00 +03:00
run: "& winbuild\\build\\build_dep_openjpeg.cmd"
2019-09-27 13:37:54 +03:00
# GPL licensed; skip if building wheels
- name: Build dependencies / libimagequant
if: "github.event_name != 'push' || contains(matrix.python-version, 'pypy')"
2020-01-01 04:43:00 +03:00
run: "& winbuild\\build\\build_dep_libimagequant.cmd"
2019-09-27 13:37:54 +03:00
2019-12-31 20:13:16 +03:00
# Raqm dependencies
2019-09-30 02:04:26 +03:00
- name: Build dependencies / HarfBuzz
2020-01-01 04:43:00 +03:00
run: "& winbuild\\build\\build_dep_harfbuzz.cmd"
2019-09-30 02:04:26 +03:00
- name: Build dependencies / FriBidi
2020-01-01 04:43:00 +03:00
run: "& winbuild\\build\\build_dep_fribidi.cmd"
2019-09-30 11:37:46 +03:00
- name: Build dependencies / Raqm
2020-01-01 04:43:00 +03:00
run: "& winbuild\\build\\build_dep_libraqm.cmd"
2019-09-30 11:37:46 +03:00
2019-09-23 23:01:19 +03:00
- name: Build Pillow
run: |
2020-01-01 03:48:13 +03:00
& winbuild\build\build_pillow.cmd install
& $env:pythonLocation\python.exe selftest.py --installed
shell: pwsh
2019-10-14 23:22:21 +03:00
# failing with PyPy3
- name: Enable heap verification
if: "!contains(matrix.python-version, 'pypy')"
2019-12-31 20:13:16 +03:00
run: "& 'C:\\Program Files (x86)\\Windows Kits\\10\\Debuggers\\x86\\gflags.exe' /p /enable $env:pythonLocation\\python.exe"
2019-09-23 23:01:19 +03:00
- name: Test Pillow
2019-09-23 23:45:21 +03:00
run: |
path %GITHUB_WORKSPACE%\\winbuild\\build\\bin;%PATH%
python.exe -m pytest -vx -W always --cov PIL --cov Tests --cov-report term --cov-report xml Tests
shell: cmd
2019-10-14 23:22:21 +03:00
- name: Prepare to upload errors
if: failure()
run: |
mkdir -p Tests/errors
shell: pwsh
2019-10-12 13:59:03 +03:00
- name: Upload errors
uses: actions/upload-artifact@v1
if: failure()
with:
name: errors
path: Tests/errors
2020-01-19 15:45:41 +03:00
- name: After success
run: |
.ci/after_success.sh
2020-01-19 22:20:13 +03:00
shell: pwsh
2020-01-19 15:45:41 +03:00
2019-09-23 23:45:21 +03:00
- name: Upload coverage
2019-12-24 11:11:46 +03:00
uses: codecov/codecov-action@v1
with:
2019-12-31 20:13:16 +03:00
file: ./coverage.xml
flags: GHA_Windows
2020-01-01 03:48:13 +03:00
name: ${{ runner.os }} Python ${{ matrix.python-version }} ${{ matrix.architecture }}
2019-09-25 10:58:29 +03:00
- name: Build wheel
id: wheel
if: "github.event_name == 'push' && !contains(matrix.python-version, 'pypy')"
2019-12-31 20:13:16 +03:00
run: |
for /f "tokens=3 delims=/" %%a in ("${{ github.ref }}") do echo ::set-output name=dist::dist-%%a
2020-01-01 04:43:00 +03:00
winbuild\\build\\build_pillow.cmd bdist_wheel"
2019-12-31 20:13:16 +03:00
shell: cmd
2019-09-25 10:58:29 +03:00
- uses: actions/upload-artifact@v1
if: "github.event_name == 'push' && !contains(matrix.python-version, 'pypy')"
with:
2019-12-31 20:13:16 +03:00
name: ${{ steps.wheel.outputs.dist }}
2019-09-25 10:58:29 +03:00
path: dist