From 747e44ba8fb4fb8807799d7cff46f18b89f3ca1e Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Fri, 18 Dec 2020 21:36:57 +0200 Subject: [PATCH] TEMP reduce CI --- .github/workflows/lint.yml | 48 ----- .github/workflows/test-docker.yml | 86 --------- .github/workflows/test-windows.yml | 293 ----------------------------- .github/workflows/test.yml | 9 - 4 files changed, 436 deletions(-) delete mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/test-docker.yml delete mode 100644 .github/workflows/test-windows.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 3c658293eab..00000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Lint - -on: [push, pull_request] - -jobs: - build: - - runs-on: ubuntu-latest - - name: Lint - - steps: - - uses: actions/checkout@v2 - - - name: pip cache - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: lint-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - lint-pip- - - - name: pre-commit cache - uses: actions/cache@v2 - with: - path: ~/.cache/pre-commit - key: lint-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }} - restore-keys: | - lint-pre-commit- - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - - name: Build system information - run: python .github/workflows/system-info.py - - - name: Install dependencies - run: | - python -m pip install -U pip - python -m pip install -U tox - - - name: Lint - run: tox -e lint - env: - PRE_COMMIT_COLOR: always - diff --git a/.github/workflows/test-docker.yml b/.github/workflows/test-docker.yml deleted file mode 100644 index eb173c3594a..00000000000 --- a/.github/workflows/test-docker.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: Test Docker - -on: [push, pull_request] - -jobs: - build: - - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - docker: [ - # Run slower jobs first to give them a headstart and reduce waiting time - ubuntu-20.04-focal-arm64v8, - ubuntu-20.04-focal-ppc64le, - ubuntu-20.04-focal-s390x, - # Then run the remainder - alpine, - amazon-2-amd64, - arch, - centos-7-amd64, - centos-8-amd64, - debian-10-buster-x86, - fedora-32-amd64, - fedora-33-amd64, - ubuntu-18.04-bionic-amd64, - ubuntu-20.04-focal-amd64, - ] - dockerTag: [master] - include: - - docker: "ubuntu-20.04-focal-arm64v8" - qemu-arch: "aarch64" - - docker: "ubuntu-20.04-focal-ppc64le" - qemu-arch: "ppc64le" - - docker: "ubuntu-20.04-focal-s390x" - qemu-arch: "s390x" - - name: ${{ matrix.docker }} - - steps: - - uses: actions/checkout@v2 - - - name: Build system information - run: python .github/workflows/system-info.py - - - name: Set up QEMU - if: "matrix.qemu-arch" - run: | - docker run --rm --privileged aptman/qus -s -- -p ${{ matrix.qemu-arch }} - - - name: Docker pull - run: | - docker pull pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }} - - - name: Docker build - run: | - # The Pillow user in the docker container is UID 1000 - sudo chown -R 1000 $GITHUB_WORKSPACE - docker run --name pillow_container -v $GITHUB_WORKSPACE:/Pillow pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }} - sudo chown -R runner $GITHUB_WORKSPACE - - - name: After success - run: | - PATH="$PATH:~/.local/bin" - docker start pillow_container - pil_path=`docker exec pillow_container /vpy3/bin/python -c 'import os, PIL;print(os.path.realpath(os.path.dirname(PIL.__file__)))'` - docker stop pillow_container - sudo mkdir -p $pil_path - sudo cp src/PIL/*.py $pil_path - .ci/after_success.sh - env: - MATRIX_DOCKER: ${{ matrix.docker }} - - - name: Upload coverage - uses: codecov/codecov-action@v1 - with: - flags: GHA_Docker - name: ${{ matrix.docker }} - - success: - needs: build - runs-on: ubuntu-latest - name: Docker Test Successful - steps: - - name: Success - run: echo Docker Test Successful diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml deleted file mode 100644 index 562b2b7b406..00000000000 --- a/.github/workflows/test-windows.yml +++ /dev/null @@ -1,293 +0,0 @@ -name: Test Windows - -on: [push, pull_request] - -jobs: - build: - runs-on: windows-2019 - strategy: - fail-fast: false - matrix: - python-version: ["pypy-3.6", "pypy-3.7", "3.6", "3.7", "3.8", "3.9", "3.10-dev"] - architecture: ["x86", "x64"] - include: - - architecture: "x86" - platform-vcvars: "x86" - platform-msbuild: "Win32" - - architecture: "x64" - platform-vcvars: "x86_amd64" - platform-msbuild: "x64" - exclude: - # PyPy does not support 64-bit on Windows - - python-version: "pypy-3.6" - architecture: "x64" - - python-version: "pypy-3.7" - architecture: "x64" - timeout-minutes: 30 - - name: Python ${{ matrix.python-version }} ${{ matrix.architecture }} - - steps: - - name: Checkout Pillow - uses: actions/checkout@v2 - - - name: Checkout cached dependencies - uses: actions/checkout@v2 - with: - repository: python-pillow/pillow-depends - path: winbuild\depends - - - name: Cache pip - uses: actions/cache@v2 - with: - path: ~\AppData\Local\pip\Cache - key: - ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.architecture }}-${{ hashFiles('**/.github/workflows/test-windows.yml') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.architecture }}- - ${{ runner.os }}-${{ matrix.python-version }}- - - # sets env: pythonLocation - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - architecture: ${{ matrix.architecture }} - - - name: Print build system information - run: python .github/workflows/system-info.py - - - name: python -m pip install wheel pytest pytest-cov - run: python -m pip install wheel pytest pytest-cov - - # TODO Remove when 3.8 / 3.9 includes setuptools 49.3.2+: - - name: Upgrade setuptools - if: "contains(matrix.python-version, '3.8') || contains(matrix.python-version, '3.9')" - run: python -m pip install -U "setuptools>=49.3.2" - - - name: Install dependencies - id: install - run: | - 7z x winbuild\depends\nasm-2.14.02-win64.zip "-o$env:RUNNER_WORKSPACE\" - echo "$env:RUNNER_WORKSPACE\nasm-2.14.02" >> $env:GITHUB_PATH - - winbuild\depends\gs9533w32.exe /S - echo "C:\Program Files (x86)\gs\gs9.53.3\bin" >> $env:GITHUB_PATH - - xcopy /S /Y winbuild\depends\test_images\* Tests\images\ - - # 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 "::set-output name=vs::$a" } - shell: pwsh - - - name: Cache build - id: build-cache - uses: actions/cache@v2 - 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 --python=$env:pythonLocation --srcdir - 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 / LibTiff - if: steps.build-cache.outputs.cache-hit != 'true' - run: "& winbuild\\build\\build_dep_libtiff.cmd" - - - name: Build dependencies / WebP - if: steps.build-cache.outputs.cache-hit != 'true' - run: "& winbuild\\build\\build_dep_libwebp.cmd" - - # for FreeType CBDT font support - - name: Build dependencies / libpng - if: steps.build-cache.outputs.cache-hit != 'true' - run: "& winbuild\\build\\build_dep_libpng.cmd" - - - name: Build dependencies / FreeType - if: steps.build-cache.outputs.cache-hit != 'true' - run: "& winbuild\\build\\build_dep_freetype.cmd" - - - name: Build dependencies / LCMS2 - if: steps.build-cache.outputs.cache-hit != 'true' - run: "& winbuild\\build\\build_dep_lcms2.cmd" - - - name: Build dependencies / OpenJPEG - if: steps.build-cache.outputs.cache-hit != 'true' - run: "& winbuild\\build\\build_dep_openjpeg.cmd" - - # GPL licensed - - name: Build dependencies / libimagequant - if: steps.build-cache.outputs.cache-hit != 'true' - run: "& winbuild\\build\\build_dep_libimagequant.cmd" - - # Raqm dependencies - - name: Build dependencies / HarfBuzz - if: steps.build-cache.outputs.cache-hit != 'true' - run: "& winbuild\\build\\build_dep_harfbuzz.cmd" - - - name: Build dependencies / FriBidi - if: steps.build-cache.outputs.cache-hit != 'true' - run: "& winbuild\\build\\build_dep_fribidi.cmd" - - - name: Build dependencies / Raqm - if: steps.build-cache.outputs.cache-hit != 'true' - run: "& winbuild\\build\\build_dep_libraqm.cmd" - - # trim ~150MB x 9 - - 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="" - if ('${{ github.event_name }}' -eq 'push') { $FLAGS="--disable-imagequant" } - & winbuild\build\build_pillow.cmd $FLAGS install - & $env:pythonLocation\python.exe selftest.py --installed - shell: pwsh - - # failing with PyPy3 - - name: Enable heap verification - if: "!contains(matrix.python-version, 'pypy')" - run: "& 'C:\\Program Files (x86)\\Windows Kits\\10\\Debuggers\\x86\\gflags.exe' /p /enable $env:pythonLocation\\python.exe" - - - name: Test Pillow - run: | - path %GITHUB_WORKSPACE%\\winbuild\\build\\bin;%PATH% - python.exe -m pytest -vx -W always --cov PIL --cov Tests --cov-report term --cov-report xml Tests - shell: cmd - - - name: Prepare to upload errors - if: failure() - run: | - mkdir -p Tests/errors - shell: pwsh - - - name: Upload errors - uses: actions/upload-artifact@v2 - if: failure() - with: - name: errors - path: Tests/errors - - - name: After success - run: | - .ci/after_success.sh - shell: pwsh - - - name: Upload coverage - uses: codecov/codecov-action@v1 - with: - file: ./coverage.xml - flags: GHA_Windows - name: ${{ runner.os }} Python ${{ matrix.python-version }} ${{ matrix.architecture }} - - - name: Build wheel - id: wheel - # Skip wheels on 3.10 due to https://github.com/pypa/wheel/issues/354 - if: "github.event_name == 'push' && !contains(matrix.python-version, '3.10')" - run: | - for /f "tokens=3 delims=/" %%a in ("${{ github.ref }}") do echo ::set-output name=dist::dist-%%a - winbuild\\build\\build_pillow.cmd --disable-imagequant bdist_wheel - shell: cmd - - - uses: actions/upload-artifact@v2 - # Skip wheels on 3.10 due to https://github.com/pypa/wheel/issues/354 - if: "github.event_name == 'push' && !contains(matrix.python-version, '3.10')" - with: - name: ${{ steps.wheel.outputs.dist }} - path: dist\*.whl - - msys: - runs-on: windows-2019 - - strategy: - fail-fast: false - matrix: - mingw: ["MINGW32", "MINGW64"] - include: - - mingw: "MINGW32" - name: "MSYS2 MinGW 32-bit" - package: "mingw-w64-i686" - - mingw: "MINGW64" - name: "MSYS2 MinGW 64-bit" - package: "mingw-w64-x86_64" - - defaults: - run: - shell: bash.exe --login -eo pipefail "{0}" - env: - MSYSTEM: ${{ matrix.mingw }} - CHERE_INVOKING: 1 - - timeout-minutes: 30 - name: ${{ matrix.name }} - - steps: - - uses: actions/checkout@v2 - - - name: Set up shell - run: echo "C:\msys64\usr\bin\" >> $env:GITHUB_PATH - shell: pwsh - - - name: Install Dependencies - run: | - pacman -S --noconfirm \ - ${{ matrix.package }}-python3-cffi \ - ${{ matrix.package }}-python3-numpy \ - ${{ matrix.package }}-python3-olefile \ - ${{ matrix.package }}-python3-pip \ - ${{ matrix.package }}-python3-pyqt5 \ - ${{ matrix.package }}-python3-pytest \ - ${{ matrix.package }}-python3-pytest-cov \ - ${{ matrix.package }}-python3-setuptools \ - ${{ matrix.package }}-freetype \ - ${{ matrix.package }}-ghostscript \ - ${{ matrix.package }}-lcms2 \ - ${{ matrix.package }}-libimagequant \ - ${{ matrix.package }}-libjpeg-turbo \ - ${{ matrix.package }}-libraqm \ - ${{ matrix.package }}-libtiff \ - ${{ matrix.package }}-libwebp \ - ${{ matrix.package }}-openjpeg2 \ - subversion - - python3 -m pip install pyroma - - pushd depends && ./install_extra_test_images.sh && popd - - - name: Build Pillow - run: CFLAGS="-coverage" python3 setup.py build_ext install - - - name: Test Pillow - run: | - python3 selftest.py --installed - python3 -m pytest -vx --cov PIL --cov Tests --cov-report term --cov-report xml Tests - - - name: Upload coverage - run: | - python3 -m pip install codecov - bash <(curl -s https://codecov.io/bash) -F GHA_Windows - env: - CODECOV_NAME: ${{ matrix.name }} - - success: - needs: [build, msys] - runs-on: ubuntu-latest - name: Windows Test Successful - steps: - - name: Success - run: echo Windows Test Successful diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 305ad7ba8f6..914cceb1c09 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,27 +10,18 @@ jobs: matrix: os: [ "ubuntu-latest", - "macOS-latest", ] python-version: [ "pypy-3.7", - "pypy-3.6", - "3.10-dev", "3.9", - "3.8", - "3.7", "3.6", ] include: - python-version: "3.6" PYTHONOPTIMIZE: 1 - - python-version: "3.7" - PYTHONOPTIMIZE: 2 # Include new variables for Codecov - os: ubuntu-latest codecov-flag: GHA_Ubuntu - - os: macOS-latest - codecov-flag: GHA_macOS runs-on: ${{ matrix.os }} name: ${{ matrix.os }} Python ${{ matrix.python-version }}