Merge pull request #4081 from hugovk/test-with-github-actions

Test Linux and macOS with GitHub Actions
This commit is contained in:
Hugo van Kemenade 2019-10-12 13:07:28 +03:00 committed by GitHub
commit 6595ce1609
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 101 additions and 9 deletions

View File

@ -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

View File

@ -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: |

19
.github/workflows/macos-install.sh vendored Executable file
View File

@ -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

67
.github/workflows/test.yml vendored Normal file
View File

@ -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 }}

View File

@ -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

7
.travis/build.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
set -e
coverage erase
make clean
make install-coverage

View File

@ -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