diff --git a/.codecov.yml b/.codecov.yml index 3e147d1511f..a93095486ce 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 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4bd02b674d0..f72342c5c5d 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/macos-install.sh b/.github/workflows/macos-install.sh new file mode 100755 index 00000000000..473a1695ead --- /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 new file mode 100644 index 00000000000..d6676ace7af --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,67 @@ +name: Test + +on: [push, pull_request] + +jobs: + build: + + strategy: + fail-fast: false + matrix: + os: [ + "ubuntu-18.04", + "macOS-10.14", + ] + python-version: [ + "pypy3", + "3.7", + "3.5", + "3.6", + ] + include: + - python-version: "3.5" + env: PYTHONOPTIMIZE=2 + - python-version: "3.6" + env: PYTHONOPTIMIZE=1 + runs-on: ${{ matrix.os }} + name: ${{ matrix.os }} 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 Linux dependencies + if: startsWith(matrix.os, 'ubuntu') + run: | + .travis/install.sh + + - name: Install macOS dependencies + if: startsWith(matrix.os, 'macOS') + run: | + .github/workflows/macos-install.sh + + - name: Build + run: | + .travis/build.sh + + - name: Test + run: | + .travis/test.sh + + - name: Docs + if: matrix.python-version == 3.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 }} diff --git a/.travis.yml b/.travis.yml index 3be6e065ca0..2d0f7ed40ee 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 00000000000..3b286076f89 --- /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 af56cc6ab92..67c390ebd82 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