From e595ddbaa1eeeee88c11314cba3fd042c120d8ef Mon Sep 17 00:00:00 2001 From: Hugo Date: Sun, 22 Sep 2019 17:09:27 +0300 Subject: [PATCH 1/7] Test with GitHub Actions --- .github/workflows/lint.yml | 8 +++--- .github/workflows/test.yml | 54 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4bd02b674..f72342c5c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,17 +8,17 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: [3.7] + python-version: ["3.7"] - name: Python ${{ matrix.python }} + name: Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python }} + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v1 with: - python-version: ${{ matrix.python }} + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..fb09b0ffa --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,54 @@ +name: Test + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [ + "pypy3", + "pypy2", + "3.7", + "2.7", + "3.5", + "3.6", + ] + include: + - python-version: "3.5" + env: PYTHONOPTIMIZE=2 + - python-version: "3.6" + env: PYTHONOPTIMIZE=1 + name: Python ${{ matrix.python-version }} + + steps: + - uses: actions/checkout@v1 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + .travis/install.sh + + - name: Test + run: | + .travis/script.sh + + - name: Docs + if: matrix.python-version == 2.7 + run: | + pip install sphinx-rtd-theme + make doccheck + + - name: After success + if: success() + run: | + .travis/after_success.sh + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} From 7c7c53fbb6db8028a09b46c788d89f7efde42e42 Mon Sep 17 00:00:00 2001 From: Hugo Date: Sun, 22 Sep 2019 23:09:59 +0300 Subject: [PATCH 2/7] Test macOS with GitHub Actions --- .github/workflows/macos-install.sh | 19 +++++++++++++++++++ .github/workflows/test.yml | 16 +++++++++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) create mode 100755 .github/workflows/macos-install.sh diff --git a/.github/workflows/macos-install.sh b/.github/workflows/macos-install.sh new file mode 100755 index 000000000..473a1695e --- /dev/null +++ b/.github/workflows/macos-install.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e + +sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target / + +brew install libtiff libjpeg webp little-cms2 + +PYTHONOPTIMIZE=0 pip install cffi +pip install coverage +pip install olefile +pip install -U pytest +pip install -U pytest-cov +pip install pyroma +pip install test-image-results +pip install numpy + +# extra test images +pushd depends && ./install_extra_test_images.sh && popd diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fb09b0ffa..10596655f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,9 +5,12 @@ on: [push, pull_request] jobs: build: - runs-on: ubuntu-latest strategy: matrix: + os: [ + "ubuntu-18.04", + "macOS-10.14", + ] python-version: [ "pypy3", "pypy2", @@ -21,7 +24,8 @@ jobs: env: PYTHONOPTIMIZE=2 - python-version: "3.6" env: PYTHONOPTIMIZE=1 - name: Python ${{ matrix.python-version }} + runs-on: ${{ matrix.os }} + name: ${{ matrix.os }} Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v1 @@ -31,10 +35,16 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install dependencies + - name: Install Linux dependencies + if: matrix.os == 'ubuntu-18.04' run: | .travis/install.sh + - name: Install macOS dependencies + if: matrix.os == 'macOS-10.14' + run: | + .github/workflows/macos-install.sh + - name: Test run: | .travis/script.sh From ac5642dc76e947b44bc593c0e6f6299ce64838e0 Mon Sep 17 00:00:00 2001 From: Hugo Date: Mon, 23 Sep 2019 17:02:09 +0300 Subject: [PATCH 3/7] Split script.sh into build.sh and test.sh --- .github/workflows/test.yml | 6 +++++- .travis.yml | 3 ++- .travis/build.sh | 7 +++++++ .travis/{script.sh => test.sh} | 4 ---- 4 files changed, 14 insertions(+), 6 deletions(-) create mode 100755 .travis/build.sh rename .travis/{script.sh => test.sh} (75%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 10596655f..dcfd4eb99 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,9 +45,13 @@ jobs: run: | .github/workflows/macos-install.sh + - name: Build + run: | + .travis/build.sh + - name: Test run: | - .travis/script.sh + .travis/test.sh - name: Docs if: matrix.python-version == 2.7 diff --git a/.travis.yml b/.travis.yml index 3be6e065c..2d0f7ed40 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,7 +64,8 @@ script: if [ "$LINT" == "true" ]; then tox -e lint elif [ "$DOCKER" == "" ]; then - .travis/script.sh + .travis/build.sh + .travis/test.sh elif [ "$DOCKER" ]; then # the Pillow user in the docker container is UID 1000 sudo chown -R 1000 $TRAVIS_BUILD_DIR diff --git a/.travis/build.sh b/.travis/build.sh new file mode 100755 index 000000000..3b286076f --- /dev/null +++ b/.travis/build.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -e + +coverage erase +make clean +make install-coverage diff --git a/.travis/script.sh b/.travis/test.sh similarity index 75% rename from .travis/script.sh rename to .travis/test.sh index af56cc6ab..67c390ebd 100755 --- a/.travis/script.sh +++ b/.travis/test.sh @@ -2,10 +2,6 @@ set -e -coverage erase -make clean -make install-coverage - python -m pytest -v -x --cov PIL --cov-report term Tests # Docs From 01373b4ed9445546c3272477505316cdc3ab67a9 Mon Sep 17 00:00:00 2001 From: Hugo Date: Sun, 29 Sep 2019 21:28:10 +0300 Subject: [PATCH 4/7] Add Codecov token to config --- .codecov.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.codecov.yml b/.codecov.yml index 3e147d151..a93095486 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -6,4 +6,6 @@ codecov: # https://docs.codecov.io/v4.3.6/docs/comparing-commits allow_coverage_offsets: true + token: 6dafc396-e7f5-4221-a38a-8b07a49fbdae + comment: off From cf8f8b17437d366e9a4fa0549865fdc5d7e09114 Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 1 Oct 2019 18:27:22 +0300 Subject: [PATCH 5/7] Drop support for EOL Python 2.7 --- .github/workflows/test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dcfd4eb99..eddf4f8d3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,9 +13,7 @@ jobs: ] python-version: [ "pypy3", - "pypy2", "3.7", - "2.7", "3.5", "3.6", ] @@ -54,7 +52,7 @@ jobs: .travis/test.sh - name: Docs - if: matrix.python-version == 2.7 + if: matrix.python-version == 3.7 run: | pip install sphinx-rtd-theme make doccheck From 707c9910ab6ca5a285bc79f13d29c5e5b3cfeeb8 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 9 Oct 2019 15:10:27 +0300 Subject: [PATCH 6/7] Install OS dependencies without checking version number --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eddf4f8d3..55b280124 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,12 +34,12 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install Linux dependencies - if: matrix.os == 'ubuntu-18.04' + if: startsWith(matrix.os, 'ubuntu') run: | .travis/install.sh - name: Install macOS dependencies - if: matrix.os == 'macOS-10.14' + if: startsWith(matrix.os, 'macOS') run: | .github/workflows/macos-install.sh From a4d7861e342ce362120d1b1b5d66a05d8903514a Mon Sep 17 00:00:00 2001 From: Hugo Date: Sat, 12 Oct 2019 12:14:49 +0300 Subject: [PATCH 7/7] Turn fail-fast off, so one failed job doesn't cancel others --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 55b280124..d6676ace7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,6 +6,7 @@ jobs: build: strategy: + fail-fast: false matrix: os: [ "ubuntu-18.04",