num_layers #7806
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Windows | |
on: | |
push: | |
branches: | |
- "**" | |
paths-ignore: | |
- ".github/workflows/docs.yml" | |
- ".github/workflows/wheels*" | |
- ".gitmodules" | |
- "docs/**" | |
- "wheels/**" | |
pull_request: | |
paths-ignore: | |
- ".github/workflows/docs.yml" | |
- ".github/workflows/wheels*" | |
- ".gitmodules" | |
- "docs/**" | |
- "wheels/**" | |
workflow_dispatch: | |
permissions: | |
contents: read | |
env: | |
COVERAGE_CORE: sysmon | |
jobs: | |
build: | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.12"] | |
timeout-minutes: 30 | |
name: Python ${{ matrix.python-version }} | |
steps: | |
- name: Checkout Pillow | |
uses: actions/checkout@v4 | |
# sets env: pythonLocation | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
allow-prereleases: true | |
cache: pip | |
cache-dependency-path: ".github/workflows/test-windows.yml" | |
- name: Print build system information | |
run: python3 .github/workflows/system-info.py | |
- name: Install dependencies | |
id: install | |
run: | | |
# make cache key depend on VS version | |
& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" ` | |
| find """catalog_buildVersion""" ` | |
| ForEach-Object { $a = $_.split(" ")[1]; echo "vs=$a" >> $env:GITHUB_OUTPUT } | |
shell: pwsh | |
- name: Cache build | |
id: build-cache | |
uses: actions/cache@v4 | |
with: | |
path: winbuild\build | |
key: | |
${{ hashFiles('winbuild\build_prepare.py') }}-${{ hashFiles('.github\workflows\test-windows.yml') }}-${{ env.pythonLocation }}-${{ steps.install.outputs.vs }} | |
- name: Prepare build | |
if: steps.build-cache.outputs.cache-hit != 'true' | |
run: | | |
& python.exe winbuild\build_prepare.py -v | |
shell: pwsh | |
- name: Build dependencies / libjpeg-turbo | |
if: steps.build-cache.outputs.cache-hit != 'true' | |
run: "& winbuild\\build\\build_dep_libjpeg.cmd" | |
- name: Build dependencies / zlib | |
if: steps.build-cache.outputs.cache-hit != 'true' | |
run: "& winbuild\\build\\build_dep_zlib.cmd" | |
- name: Build dependencies / OpenJPEG | |
run: "& winbuild\\build\\build_dep_openjpeg.cmd" | |
# trim ~150MB for each job | |
- name: Optimize build cache | |
if: steps.build-cache.outputs.cache-hit != 'true' | |
run: rmdir /S /Q winbuild\build\src | |
shell: cmd | |
- name: Build Pillow | |
run: | | |
$FLAGS="-C raqm=vendor -C fribidi=vendor" | |
cmd /c "winbuild\build\build_env.cmd && $env:pythonLocation\python.exe -m pip install -v $FLAGS ." | |
& $env:pythonLocation\python.exe selftest.py --installed | |
shell: pwsh | |
- name: Test Pillow | |
run: | | |
path %GITHUB_WORKSPACE%\\winbuild\\build\\bin;%PATH% | |
python.exe -c "from PIL import Image;im = Image.open('image');im.load()" | |
shell: cmd |