test-windows.yml matrix platform

This commit is contained in:
nulano 2019-09-24 13:33:52 +02:00
parent df1e290d88
commit 74a7fd5985

View File

@ -8,9 +8,19 @@ jobs:
runs-on: windows-2016 runs-on: windows-2016
strategy: strategy:
matrix: matrix:
python-version: ["3.5.4", "3.6.8", "3.7.4"] python-version:
- "3.5.4"
- "3.6.8"
- "3.7.4"
platform:
- name: "x86"
vars: "x86"
msbuild: "Win32"
- name: "x64"
vars: "x86_amd64"
msbuild: "x64"
name: Python ${{ matrix.python-version }} x86 name: Python ${{ matrix.python-version }} ${{ matrix.platform.name }}
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
@ -27,7 +37,7 @@ jobs:
python.exe $env:GITHUB_WORKSPACE\winbuild\build_dep.py python.exe $env:GITHUB_WORKSPACE\winbuild\build_dep.py
# .\build_deps.cmd # .\build_deps.cmd
env: env:
PYTHON: C:\hostedtoolcache\windows\Python\${{ matrix.python-version }}\x86 PYTHON: C:\hostedtoolcache\windows\Python\${{ matrix.python-version }}\${{ matrix.platform.name }}
EXECUTABLE: bin\python.exe EXECUTABLE: bin\python.exe
shell: pwsh shell: pwsh
@ -37,7 +47,7 @@ jobs:
set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32 set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32
set BUILD=%GITHUB_WORKSPACE%\winbuild\build set BUILD=%GITHUB_WORKSPACE%\winbuild\build
cd /D %BUILD%\jpeg-9c cd /D %BUILD%\jpeg-9c
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 8.1 call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" ${{ matrix.platform.vars }} 8.1
echo on echo on
nmake -nologo -f makefile.vc setup-vc6 nmake -nologo -f makefile.vc setup-vc6
nmake -nologo -f makefile.vc clean nmake -nologo -f makefile.vc clean
@ -51,7 +61,7 @@ jobs:
set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32 set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32
set BUILD=%GITHUB_WORKSPACE%\winbuild\build set BUILD=%GITHUB_WORKSPACE%\winbuild\build
cd /D %BUILD%\zlib-1.2.11 cd /D %BUILD%\zlib-1.2.11
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 8.1 call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" ${{ matrix.platform.vars }} 8.1
echo on echo on
nmake -nologo -f win32\Makefile.msc clean nmake -nologo -f win32\Makefile.msc clean
nmake -nologo -f win32\Makefile.msc zlib.lib nmake -nologo -f win32\Makefile.msc zlib.lib
@ -65,7 +75,7 @@ jobs:
set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32 set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32
set BUILD=%GITHUB_WORKSPACE%\winbuild\build set BUILD=%GITHUB_WORKSPACE%\winbuild\build
cd /D %BUILD%\tiff-4.0.10 cd /D %BUILD%\tiff-4.0.10
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 8.1 call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" ${{ matrix.platform.vars }} 8.1
echo on echo on
copy %GITHUB_WORKSPACE%\winbuild\nmake.opt nmake.opt copy %GITHUB_WORKSPACE%\winbuild\nmake.opt nmake.opt
nmake -nologo -f makefile.vc clean nmake -nologo -f makefile.vc clean
@ -80,13 +90,13 @@ jobs:
set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32 set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32
set BUILD=%GITHUB_WORKSPACE%\winbuild\build set BUILD=%GITHUB_WORKSPACE%\winbuild\build
cd /D %BUILD%\libwebp-1.0.3 cd /D %BUILD%\libwebp-1.0.3
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 8.1 call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" ${{ matrix.platform.vars }} 8.1
echo on echo on
rmdir /S /Q output\release-static rmdir /S /Q output\release-static
nmake -nologo -f Makefile.vc CFG=release-static RTLIBCFG=static OBJDIR=output ARCH=x86 all nmake -nologo -f Makefile.vc CFG=release-static RTLIBCFG=static OBJDIR=output ARCH=${{ matrix.platform.name }} all
mkdir %INCLIB%\webp mkdir %INCLIB%\webp
copy /Y /B src\webp\*.h %INCLIB%\webp copy /Y /B src\webp\*.h %INCLIB%\webp
copy /Y /B output\release-static\x86\lib\* %INCLIB% copy /Y /B output\release-static\${{ matrix.platform.name }}\lib\* %INCLIB%
- name: Build dependencies / freetype - name: Build dependencies / freetype
run: | run: |
@ -96,16 +106,16 @@ jobs:
set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32 set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32
set BUILD=%GITHUB_WORKSPACE%\winbuild\build set BUILD=%GITHUB_WORKSPACE%\winbuild\build
cd /D %BUILD%\freetype-2.10.1 cd /D %BUILD%\freetype-2.10.1
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 8.1 call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" ${{ matrix.platform.vars }} 8.1
echo on echo on
rmdir /S /Q objs rmdir /S /Q objs
set DefaultPlatformToolset=v140 set DefaultPlatformToolset=v140
set VCTargetsPath=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets set VCTargetsPath=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets
set MSBUILD="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe" set MSBUILD="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe"
%MSBUILD% builds\windows\vc2010\freetype.sln /t:Build /p:Configuration="Release" /p:Platform=Win32 /m %MSBUILD% builds\windows\vc2010\freetype.sln /t:Build /p:Configuration="Release" /p:Platform=${{ matrix.platform.msbuild }} /m
xcopy /Y /E /Q include %INCLIB% xcopy /Y /E /Q include %INCLIB%
copy /Y /B objs\Win32\Release\freetype.dll %INCLIB% copy /Y /B objs\${{ matrix.platform.msbuild }}\Release\freetype.dll %INCLIB%
copy /Y /B objs\Win32\Release\freetype.lib %INCLIB% copy /Y /B objs\${{ matrix.platform.msbuild }}\Release\freetype.lib %INCLIB%
- name: Build dependencies / lcms2 - name: Build dependencies / lcms2
if: false if: false
@ -116,13 +126,13 @@ jobs:
set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32 set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32
set BUILD=%GITHUB_WORKSPACE%\winbuild\build set BUILD=%GITHUB_WORKSPACE%\winbuild\build
cd /D %BUILD%\lcms2-2.7 cd /D %BUILD%\lcms2-2.7
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 8.1 call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" ${{ matrix.platform.vars }} 8.1
echo on echo on
rmdir /S /Q Lib rmdir /S /Q Lib
rmdir /S /Q Projects\VC2015\Release rmdir /S /Q Projects\VC2015\Release
set VCTargetsPath=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets set VCTargetsPath=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets
set MSBUILD="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe" set MSBUILD="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe"
%MSBUILD% Projects\VC2015\lcms2.sln /t:Clean;lcms2_static /p:Configuration="Release" /p:Platform=Win32 /m %MSBUILD% Projects\VC2015\lcms2.sln /t:Clean;lcms2_static /p:Configuration="Release" /p:Platform=${{ matrix.platform.msbuild }} /m
xcopy /Y /E /Q include %INCLIB% xcopy /Y /E /Q include %INCLIB%
copy /Y /B Lib\MS\*.lib %INCLIB% copy /Y /B Lib\MS\*.lib %INCLIB%
@ -132,7 +142,7 @@ jobs:
set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32 set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32
set BUILD=%GITHUB_WORKSPACE%\winbuild\build set BUILD=%GITHUB_WORKSPACE%\winbuild\build
cd /D %BUILD%\openjpeg-2.3.1msvcr10-x32 cd /D %BUILD%\openjpeg-2.3.1msvcr10-x32
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 8.1 call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" ${{ matrix.platform.vars }} 8.1
echo on echo on
cmake.exe -DBUILD_THIRDPARTY:BOOL=OFF -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles" . cmake.exe -DBUILD_THIRDPARTY:BOOL=OFF -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles" .
nmake -nologo -f Makefile clean nmake -nologo -f Makefile clean
@ -147,15 +157,14 @@ jobs:
set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32 set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32
set BUILD=%GITHUB_WORKSPACE%\winbuild\build set BUILD=%GITHUB_WORKSPACE%\winbuild\build
cd /D %BUILD%\ghostscript-9.27 cd /D %BUILD%\ghostscript-9.27
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 8.1 call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" ${{ matrix.platform.vars }} 8.1
echo on echo on
set MSVC_VERSION=14 set MSVC_VERSION=14
set RCOMP="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\RC.Exe" set RCOMP="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\RC.Exe"
if "${{ matrix.platform.name }}"=="x64" set WIN64=""
nmake -nologo -f psi\msvc.mak nmake -nologo -f psi\msvc.mak
rem Add bin to PATH variable: Copy to INCLIB, then add INCLIB to PATH in Test step. rem Add bin to PATH variable: Copy to INCLIB, then add INCLIB to PATH in Test step.
copy /Y /B bin\* %INCLIB% copy /Y /B bin\* %INCLIB%
env:
PYTHON: C:\hostedtoolcache\windows\Python\${{ matrix.python-version }}\x86
- name: Build Pillow - name: Build Pillow
run: | run: |
@ -166,19 +175,19 @@ jobs:
set DISTUTILS_USE_SDK=1 set DISTUTILS_USE_SDK=1
set LIB=%INCLIB%;%PYTHON%\tcl set LIB=%INCLIB%;%PYTHON%\tcl
set INCLUDE=%INCLIB%;%GITHUB_WORKSPACE%\depends\tcl86\include;%INCLUDE% set INCLUDE=%INCLIB%;%GITHUB_WORKSPACE%\depends\tcl86\include;%INCLUDE%
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 8.1 call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" ${{ matrix.platform.vars }} 8.1
set BLDOPT=install set BLDOPT=install
%PYTHON%\%EXECUTABLE% setup.py build_ext --add-imaging-libs=msvcrt install %PYTHON%\%EXECUTABLE% setup.py build_ext --add-imaging-libs=msvcrt install
%PYTHON%\%EXECUTABLE% -c "from PIL import _webp;import os, shutil;shutil.copy(r'%INCLIB%\freetype.dll', os.path.dirname(_webp.__file__));" %PYTHON%\%EXECUTABLE% -c "from PIL import _webp;import os, shutil;shutil.copy(r'%INCLIB%\freetype.dll', os.path.dirname(_webp.__file__));"
%PYTHON%\%EXECUTABLE% selftest.py --installed %PYTHON%\%EXECUTABLE% selftest.py --installed
env: env:
PYTHON: C:\hostedtoolcache\windows\Python\${{ matrix.python-version }}\x86 PYTHON: C:\hostedtoolcache\windows\Python\${{ matrix.python-version }}\${{ matrix.platform.name }}
EXECUTABLE: python.exe EXECUTABLE: python.exe
- name: pip install pytest pytest-cov codecov - name: pip install pytest pytest-cov codecov
run: '%PYTHON%\%PIP% install pytest pytest-cov codecov' run: '%PYTHON%\%PIP% install pytest pytest-cov codecov'
env: env:
PYTHON: C:\hostedtoolcache\windows\Python\${{ matrix.python-version }}\x86 PYTHON: C:\hostedtoolcache\windows\Python\${{ matrix.python-version }}\${{ matrix.platform.name }}
PIP: Scripts\pip.exe PIP: Scripts\pip.exe
- name: Test Pillow - name: Test Pillow
@ -189,7 +198,7 @@ jobs:
cd /D %GITHUB_WORKSPACE% cd /D %GITHUB_WORKSPACE%
%PYTHON%\%EXECUTABLE% -m pytest -vx --cov PIL --cov-report term --cov-report xml Tests %PYTHON%\%EXECUTABLE% -m pytest -vx --cov PIL --cov-report term --cov-report xml Tests
env: env:
PYTHON: C:\hostedtoolcache\windows\Python\${{ matrix.python-version }}\x86 PYTHON: C:\hostedtoolcache\windows\Python\${{ matrix.python-version }}\${{ matrix.platform.name }}
EXECUTABLE: python.exe EXECUTABLE: python.exe
- name: Upload coverage - name: Upload coverage
@ -197,6 +206,6 @@ jobs:
cd /D %GITHUB_WORKSPACE% cd /D %GITHUB_WORKSPACE%
%PYTHON%\%CODECOV% --file coverage.xml --name %PYTHON% %PYTHON%\%CODECOV% --file coverage.xml --name %PYTHON%
env: env:
PYTHON: C:\hostedtoolcache\windows\Python\${{ matrix.python-version }}\x86 PYTHON: C:\hostedtoolcache\windows\Python\${{ matrix.python-version }}\${{ matrix.platform.name }}
CODECOV: Scripts\codecov.exe CODECOV: Scripts\codecov.exe