From a0f62fc3064a4aee14b1544bbbe639ecd14811e1 Mon Sep 17 00:00:00 2001 From: nulano Date: Mon, 23 Sep 2019 13:47:45 +0200 Subject: [PATCH] test-windows.yml bulid_dep nmake --- .github/workflows/test-windows.yml | 93 ++++++++++++++++++++++++++---- winbuild/config.py | 3 + 2 files changed, 86 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 7c8ca949c..223758b67 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -8,25 +8,98 @@ jobs: runs-on: windows-2016 strategy: matrix: - python-version: ["3.7"] + python-version: ["3.6.8"] - name: Python ${{ matrix.python-version }} + name: Python ${{ matrix.python-version }} x86 steps: - uses: actions/checkout@v1 - - name: Prepare dependencies - run: python.exe winbuild\build_dep.py - - - name: Build dependencies - run: winbuild\build_deps.cmd + - name: Fetch dependencies + run: | + curl -fsSL -o pillow-depends.zip https://github.com/python-pillow/pillow-depends/archive/master.zip + 7z x pillow-depends.zip -oc:\ + mv c:\pillow-depends-master c:\pillow-depends + xcopy c:\pillow-depends\*.zip $env:GITHUB_WORKSPACE\winbuild\ + xcopy c:\pillow-depends\*.tar.gz $env:GITHUB_WORKSPACE\winbuild\ + xcopy /s c:\pillow-depends\test_images\* $env:GITHUB_WORKSPACE\tests\images\ + cd $env:GITHUB_WORKSPACE/winbuild/ + python.exe $env:GITHUB_WORKSPACE\winbuild\build_dep.py + # .\build_deps.cmd + env: + PYTHON: C:\hostedtoolcache\windows\Python\${{ matrix.python-version }}\x86\ + EXECUTABLE: bin\python.exe + shell: pwsh + + - name: Build dependencies / libjpeg + run: | + call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 8.1 + echo on + set INCLUDE=C:\Program Files (x86)\Microsoft SDKs\Windows\V7.1A\Include;%INCLUDE% + set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32 + set BUILD=%GITHUB_WORKSPACE%\winbuild\build + cd /D %BUILD%\jpeg-9c + nmake -nologo -f makefile.vc setup-vc6 + nmake -nologo -f makefile.vc clean + nmake -nologo -f makefile.vc nodebug=1 libjpeg.lib + copy /Y /B j*.h %INCLIB% + copy /Y /B *.lib %INCLIB% + + - name: Build dependencies / zlib + run: | + call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 8.1 + echo on + set INCLUDE=C:\Program Files (x86)\Microsoft SDKs\Windows\V7.1A\Include;%INCLUDE% + set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32 + set BUILD=%GITHUB_WORKSPACE%\winbuild\build + cd /D %BUILD%\zlib-1.2.11 + nmake -nologo -f win32\Makefile.msc clean + nmake -nologo -f win32\Makefile.msc zlib.lib + copy /Y /B z*.h %INCLIB% + copy /Y /B *.lib %INCLIB% + copy /Y /B zlib.lib %INCLIB%\z.lib + + - name: Build dependencies / libtiff + run: | + call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 8.1 + echo on + set INCLUDE=C:\Program Files (x86)\Microsoft SDKs\Windows\V7.1A\Include;%INCLUDE% + set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32 + set BUILD=%GITHUB_WORKSPACE%\winbuild\build + cd /D %BUILD%\tiff-4.0.10 + copy %GITHUB_WORKSPACE%\winbuild\nmake.opt nmake.opt + nmake -nologo -f makefile.vc clean + nmake -nologo -f makefile.vc lib + copy /Y /B libtiff\tiff*.h %INCLIB% + copy /Y /B libtiff\*.dll %INCLIB% + copy /Y /B libtiff\*.lib %INCLIB% + + - name: Build dependencies / webp + run: | + call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 8.1 + echo on + set INCLUDE=C:\Program Files (x86)\Microsoft SDKs\Windows\V7.1A\Include;%INCLUDE% + set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32 + set BUILD=%GITHUB_WORKSPACE%\winbuild\build + cd /D %BUILD%\libwebp-1.0.3 + rmdir /S /Q output\release-static + nmake -nologo -f Makefile.vc CFG=release-static RTLIBCFG=static OBJDIR=output ARCH=x86 all + mkdir %INCLIB%\webp + copy /Y /B src\webp\*.h %INCLIB%\webp + copy /Y /B output\release-static\x86\lib\* %INCLIB% - name: Build - run: python.exe winbuild\build.py + run: '%PYTHON%\%EXECUTABLE% %GITHUB_WORKSPACE%\winbuild\build.py' + env: + PYTHON: C:\hostedtoolcache\windows\Python\${{ matrix.python-version }}\x86\ + EXECUTABLE: python.exe - name: Test - run: python.exe selftest.py --installed + run: '%PYTHON%\%EXECUTABLE% %GITHUB_WORKSPACE%\selftest.py --installed' + env: + PYTHON: C:\hostedtoolcache\windows\Python\${{ matrix.python-version }}\x86\ + EXECUTABLE: python.exe - name: After success - run: echo TODO + run: echo TODO 1>&2 diff --git a/winbuild/config.py b/winbuild/config.py index debfe9527..ff775a921 100644 --- a/winbuild/config.py +++ b/winbuild/config.py @@ -4,11 +4,14 @@ SF_MIRROR = "http://iweb.dl.sourceforge.net" PILLOW_DEPENDS_DIR = "C:\\pillow-depends\\" pythons = { + # for AppVeyor "27": {"compiler": 7, "vc": 2010}, "pypy2": {"compiler": 7, "vc": 2010}, "35": {"compiler": 7.1, "vc": 2015}, "36": {"compiler": 7.1, "vc": 2015}, "37": {"compiler": 7.1, "vc": 2015}, + # for GitHub Actions + "3.6": {"compiler": 7.1, "vc": 2015}, } VIRT_BASE = "c:/vp/"