8
- ".github/workflows/docs.yml"
9
- ".github/workflows/wheels*"
15
- ".github/workflows/docs.yml"
16
- ".github/workflows/wheels*"
26
group: ${{ github.workflow }}-${{ github.ref }}
27
cancel-in-progress: true
34
runs-on: windows-latest
38
python-version: ["pypy3.10", "3.9", "3.10", "3.11", "3.12", "3.13"]
42
name: Python ${{ matrix.python-version }}
45
- name: Checkout Pillow
46
uses: actions/checkout@v4
48
- name: Checkout cached dependencies
49
uses: actions/checkout@v4
51
repository: python-pillow/pillow-depends
52
path: winbuild\depends
54
- name: Checkout extra test images
55
uses: actions/checkout@v4
57
repository: python-pillow/test-images
58
path: Tests\test-images
62
uses: actions/setup-python@v5
64
python-version: ${{ matrix.python-version }}
65
allow-prereleases: true
67
cache-dependency-path: ".github/workflows/test-windows.yml"
69
- name: Print build system information
70
run: python3 .github/workflows/system-info.py
72
- name: Install Python dependencies
74
python3 -m pip install
83
- name: Install dependencies
86
choco install nasm --no-progress
87
echo "C:\Program Files\NASM" >> $env:GITHUB_PATH
89
choco install ghostscript --version=10.3.1 --no-progress
90
echo "C:\Program Files\gs\gs10.03.1\bin" >> $env:GITHUB_PATH
93
xcopy /S /Y Tests\test-images\* Tests\images
96
& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" `
97
| find """catalog_buildVersion""" `
98
| ForEach-Object { $a = $_.split(" ")[1]; echo "vs=$a" >> $env:GITHUB_OUTPUT }
103
uses: actions/cache@v4
107
${{ hashFiles('winbuild\build_prepare.py') }}-${{ hashFiles('.github\workflows\test-windows.yml') }}-${{ env.pythonLocation }}-${{ steps.install.outputs.vs }}
109
- name: Prepare build
110
if: steps.build-cache.outputs.cache-hit != 'true'
112
& python.exe winbuild\build_prepare.py -v
115
- name: Build dependencies / libjpeg-turbo
116
if: steps.build-cache.outputs.cache-hit != 'true'
117
run: "& winbuild\\build\\build_dep_libjpeg.cmd"
119
- name: Build dependencies / zlib
120
if: steps.build-cache.outputs.cache-hit != 'true'
121
run: "& winbuild\\build\\build_dep_zlib.cmd"
123
- name: Build dependencies / xz
124
if: steps.build-cache.outputs.cache-hit != 'true'
125
run: "& winbuild\\build\\build_dep_xz.cmd"
127
- name: Build dependencies / WebP
128
if: steps.build-cache.outputs.cache-hit != 'true'
129
run: "& winbuild\\build\\build_dep_libwebp.cmd"
131
- name: Build dependencies / LibTiff
132
if: steps.build-cache.outputs.cache-hit != 'true'
133
run: "& winbuild\\build\\build_dep_libtiff.cmd"
136
- name: Build dependencies / libpng
137
if: steps.build-cache.outputs.cache-hit != 'true'
138
run: "& winbuild\\build\\build_dep_libpng.cmd"
141
- name: Build dependencies / brotli
142
if: steps.build-cache.outputs.cache-hit != 'true'
143
run: "& winbuild\\build\\build_dep_brotli.cmd"
145
- name: Build dependencies / FreeType
146
if: steps.build-cache.outputs.cache-hit != 'true'
147
run: "& winbuild\\build\\build_dep_freetype.cmd"
149
- name: Build dependencies / LCMS2
150
if: steps.build-cache.outputs.cache-hit != 'true'
151
run: "& winbuild\\build\\build_dep_lcms2.cmd"
153
- name: Build dependencies / OpenJPEG
154
if: steps.build-cache.outputs.cache-hit != 'true'
155
run: "& winbuild\\build\\build_dep_openjpeg.cmd"
158
- name: Build dependencies / libimagequant
159
if: steps.build-cache.outputs.cache-hit != 'true'
160
run: "& winbuild\\build\\build_dep_libimagequant.cmd"
163
- name: Build dependencies / HarfBuzz
164
if: steps.build-cache.outputs.cache-hit != 'true'
165
run: "& winbuild\\build\\build_dep_harfbuzz.cmd"
168
- name: Build dependencies / FriBidi
169
if: steps.build-cache.outputs.cache-hit != 'true'
170
run: "& winbuild\\build\\build_dep_fribidi.cmd"
173
- name: Optimize build cache
174
if: steps.build-cache.outputs.cache-hit != 'true'
175
run: rmdir /S /Q winbuild\build\src
180
$FLAGS="-C raqm=vendor -C fribidi=vendor"
181
cmd /c "winbuild\build\build_env.cmd && $env:pythonLocation\python.exe -m pip install -v $FLAGS ."
182
& $env:pythonLocation\python.exe selftest.py --installed
186
- name: Enable heap verification
187
if: "!contains(matrix.python-version, 'pypy')"
189
& reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\python.exe" /v "GlobalFlag" /t REG_SZ /d "0x02000000" /f
193
path %GITHUB_WORKSPACE%\\winbuild\\build\\bin;%PATH%
194
python.exe -m pytest -vx -W always --cov PIL --cov Tests --cov-report term --cov-report xml Tests
197
- name: Prepare to upload errors
200
mkdir -p Tests/errors
203
- name: Upload errors
204
uses: actions/upload-artifact@v4
210
- name: After success
215
- name: Upload coverage
216
uses: codecov/codecov-action@v4
220
name: ${{ runner.os }} Python ${{ matrix.python-version }}
221
token: ${{ secrets.CODECOV_ORG_TOKEN }}
227
runs-on: ubuntu-latest
228
name: Windows Test Successful
231
run: echo Windows Test Successful