Pillow/.github/workflows/test-cygwin.yml
DWesl 0b134250fa
CI: Use alternatives to select python version (#4)
* CI: Use alternatives to select python version

* CI: Specify full path to alternatives

/usr/sbin isn't in PATH

* DBG: Print uname to try to avoid bad pip install.

pip>=22 on 32-bit Cygwin seems to cause problems installing coverage.  I have no idea why this is, so I just skip upgrading pip there.

* FIX: Fix syntax of conditional for 32-bit Cygwin

I have no idea if it needs to be able to accept i386, but it will if it comes up.

* FIX: Revert earlier debug change.
2022-05-02 20:38:12 -04:00

131 lines
4.3 KiB
YAML

name: Test Cygwin
on: [push, pull_request, workflow_dispatch]
jobs:
build:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-minor-version: [7, 8, 9]
architecture: ["x86", "x86_64"]
timeout-minutes: 40
name: Python 3.${{ matrix.python-minor-version }} ${{ matrix.architecture }}
steps:
- name: Fix line endings
run: |
git config --global core.autocrlf input
- name: Checkout Pillow
uses: actions/checkout@v3
- name: Install Cygwin
uses: cygwin/cygwin-install-action@v2
with:
platform: ${{ matrix.architecture }}
packages: >
ImageMagick gcc-g++ ghostscript jpeg libfreetype-devel
libimagequant-devel libjpeg-devel liblapack-devel
liblcms2-devel libopenjp2-devel libraqm-devel
libtiff-devel libwebp-devel libxcb-devel libxcb-xinerama0
make netpbm perl
python3${{ matrix.python-minor-version }}-cffi
python3${{ matrix.python-minor-version }}-cython
python3${{ matrix.python-minor-version }}-devel
python3${{ matrix.python-minor-version }}-numpy
python3${{ matrix.python-minor-version }}-sip
python3${{ matrix.python-minor-version }}-tkinter
qt5-devel-tools subversion xorg-server-extra zlib-devel
- name: Add Lapack to PATH
uses: egor-tensin/cleanup-path@v1
with:
dirs: 'C:\cygwin\bin;C:\cygwin\lib\lapack'
- name: pip cache
uses: actions/cache@v3
with:
path: 'C:\cygwin\home\runneradmin\.cache\pip'
key: ${{ runner.os }}-cygwin-${{ matrix.architecture }}-pip3.${{ matrix.python-minor-version }}-${{ hashFiles('.ci/install.sh') }}
restore-keys: |
${{ runner.os }}-cygwin-${{ matrix.architecture }}-pip3.${{ matrix.python-minor-version }}-
- name: Ensure correct python minor version used in scripts
shell: bash.exe -eo pipefail -o igncr "{0}"
run: |
/usr/sbin/alternatives --set python3 /usr/bin/python3.${{ matrix.python-minor-version }}
/usr/sbin/alternatives --display python3
/usr/sbin/alternatives --set python /usr/bin/python3.${{ matrix.python-minor-version }}
/usr/sbin/alternatives --display python
- name: Build system information
run: |
dash.exe -c "python3 .github/workflows/system-info.py"
- name: Install dependencies
run: |
bash.exe .ci/install.sh
- name: Install a different NumPy
if: matrix.architecture == 'x86_64'
shell: dash.exe -l "{0}"
run: |
python3 -m pip install -U 'numpy!=1.21.*'
- name: Check imports
shell: dash.exe -l "{0}"
run: |
python3 -c 'import numpy as np; print(np.__version__)'
- name: Build
shell: bash.exe -eo pipefail -o igncr "{0}"
run: |
python3 -m coverage erase
make clean
CFLAGS="-coverage -Werror=implicit-function-declaration" python3 -m pip install -v --global-option="build_ext" .
python3 selftest.py
- name: Rebase dlls
shell: bash.exe -eo pipefail -o igncr "{0}"
run: |
/usr/bin/rebase --database $(find /usr{,/local}/lib/python3.${{ matrix.python-minor-version }}/site-packages src/PIL ${HOME}/.local/lib/ /usr/lib/lapack /usr/bin -name \*.dll -o -name \*.exe)
- name: Test
run: |
bash.exe xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh
- name: Prepare to upload errors
if: failure()
run: |
dash.exe -c "mkdir -p Tests/errors"
- name: Upload errors
uses: actions/upload-artifact@v3
if: failure()
with:
name: errors
path: Tests/errors
- name: After success
run: |
bash.exe .ci/after_success.sh
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: GHA_Cygwin
name: Cygwin Python 3.${{ matrix.python-minor-version }} ${{ matrix.architecture }}
success:
needs: build
runs-on: ubuntu-latest
name: Cygwin Test Successful
steps:
- name: Success
run: echo Cygwin Test Successful