11name : Test Windows
22
3- on : [push, pull_request]
3+ on : [push, pull_request, workflow_dispatch ]
44
55jobs :
66 build :
7- runs-on : windows-2019
7+ runs-on : windows-latest
88 strategy :
99 fail-fast : false
1010 matrix :
@@ -23,30 +23,22 @@ jobs:
2323
2424 steps :
2525 - name : Checkout Pillow
26- uses : actions/checkout@v2
26+ uses : actions/checkout@v3
2727
2828 - name : Checkout cached dependencies
29- uses : actions/checkout@v2
29+ uses : actions/checkout@v3
3030 with :
3131 repository : python-pillow/pillow-depends
3232 path : winbuild\depends
3333
34- - name : Cache pip
35- uses : actions/cache@v2
36- with :
37- path : ~\AppData\Local\pip\Cache
38- key :
39- ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.architecture }}-${{ hashFiles('**/.github/workflows/test-windows.yml') }}
40- restore-keys : |
41- ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.architecture }}-
42- ${{ runner.os }}-${{ matrix.python-version }}-
43-
4434 # sets env: pythonLocation
4535 - name : Set up Python
46- uses : actions/setup-python@v2
36+ uses : actions/setup-python@v3
4737 with :
4838 python-version : ${{ matrix.python-version }}
4939 architecture : ${{ matrix.architecture }}
40+ cache : pip
41+ cache-dependency-path : " .github/workflows/test-windows.yml"
5042
5143 - name : Print build system information
5244 run : python .github/workflows/system-info.py
6052 7z x winbuild\depends\nasm-2.15.05-win64.zip "-o$env:RUNNER_WORKSPACE\"
6153 echo "$env:RUNNER_WORKSPACE\nasm-2.15.05" >> $env:GITHUB_PATH
6254
63- winbuild\depends\gs9550w32 .exe /S
64- echo "C:\Program Files (x86)\gs\gs9.55.0 \bin" >> $env:GITHUB_PATH
55+ winbuild\depends\gs9561w32 .exe /S
56+ echo "C:\Program Files (x86)\gs\gs9.56.1 \bin" >> $env:GITHUB_PATH
6557
6658 xcopy /S /Y winbuild\depends\test_images\* Tests\images\
6759
@@ -140,15 +132,16 @@ jobs:
140132 - name : Build Pillow
141133 run : |
142134 $FLAGS=""
143- if ('${{ github.event_name }}' -eq 'push ') { $FLAGS="--disable-imagequant" }
135+ if ('${{ github.event_name }}' -ne 'pull_request ') { $FLAGS="--disable-imagequant" }
144136 & winbuild\build\build_pillow.cmd $FLAGS install
145137 & $env:pythonLocation\python.exe selftest.py --installed
146138 shell : pwsh
147139
148- # failing with PyPy3
140+ # skip PyPy for speed
149141 - name : Enable heap verification
150142 if : " !contains(matrix.python-version, 'pypy')"
151- run : " & 'C:\\ Program Files (x86)\\ Windows Kits\\ 10\\ Debuggers\\ x86\\ gflags.exe' /p /enable $env:pythonLocation\\ python.exe"
143+ run : |
144+ & reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\python.exe" /v "GlobalFlag" /t REG_SZ /d "0x02000000" /f
152145
153146 - name : Test Pillow
154147 run : |
@@ -163,7 +156,7 @@ jobs:
163156 shell : bash
164157
165158 - name : Upload errors
166- uses : actions/upload-artifact@v2
159+ uses : actions/upload-artifact@v3
167160 if : failure()
168161 with :
169162 name : errors
@@ -183,14 +176,14 @@ jobs:
183176
184177 - name : Build wheel
185178 id : wheel
186- if : " github.event_name == 'push '"
179+ if : " github.event_name != 'pull_request '"
187180 run : |
188181 for /f "tokens=3 delims=/" %%a in ("${{ github.ref }}") do echo ::set-output name=dist::dist-%%a
189182 winbuild\\build\\build_pillow.cmd --disable-imagequant bdist_wheel
190183 shell : cmd
191184
192- - uses : actions/upload-artifact@v2
193- if : " github.event_name == 'push '"
185+ - uses : actions/upload-artifact@v3
186+ if : " github.event_name != 'pull_request '"
194187 with :
195188 name : ${{ steps.wheel.outputs.dist }}
196189 path : dist\*.whl
0 commit comments