Pillow/.github/workflows/test.yml

104 lines
2.5 KiB
YAML
Raw Normal View History

2019-09-22 17:09:27 +03:00
name: Test
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
2019-09-22 17:09:27 +03:00
matrix:
2019-09-22 23:09:59 +03:00
os: [
"ubuntu-latest",
"macOS-latest",
2019-09-22 23:09:59 +03:00
]
2019-09-22 17:09:27 +03:00
python-version: [
"pypy3",
2019-11-04 23:55:50 +03:00
"3.8",
2019-09-22 17:09:27 +03:00
"3.7",
"3.6",
2019-11-04 23:55:50 +03:00
"3.5",
2019-09-22 17:09:27 +03:00
]
include:
- python-version: "3.5"
env: PYTHONOPTIMIZE=2
- python-version: "3.6"
env: PYTHONOPTIMIZE=1
2019-09-22 23:09:59 +03:00
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
2019-09-22 17:09:27 +03:00
steps:
- uses: actions/checkout@v1
2019-11-04 10:06:09 +03:00
- name: Ubuntu cache
uses: actions/cache@v1
2019-11-04 10:06:09 +03:00
if: startsWith(matrix.os, 'ubuntu')
with:
path: ~/.cache/pip
key:
${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/.travis/*.sh') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-
2019-11-04 10:06:09 +03:00
- name: macOS cache
uses: actions/cache@v1
2019-11-04 10:06:09 +03:00
if: startsWith(matrix.os, 'macOS')
with:
path: ~/Library/Caches/pip
key:
${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/.travis/*.sh') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-
2019-11-04 10:06:09 +03:00
2019-09-22 17:09:27 +03:00
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Build system information
run: python .github/workflows/system-info.py
2019-09-22 23:09:59 +03:00
- name: Install Linux dependencies
if: startsWith(matrix.os, 'ubuntu')
2019-09-22 17:09:27 +03:00
run: |
.travis/install.sh
2019-09-22 23:09:59 +03:00
- name: Install macOS dependencies
if: startsWith(matrix.os, 'macOS')
2019-09-22 23:09:59 +03:00
run: |
.github/workflows/macos-install.sh
- name: Build
run: |
.travis/build.sh
2019-09-22 17:09:27 +03:00
- name: Test
run: |
.travis/test.sh
2019-09-22 17:09:27 +03:00
2019-10-12 13:59:03 +03:00
- name: Upload errors
uses: actions/upload-artifact@v1
if: failure()
with:
name: errors
path: Tests/errors
2019-09-22 17:09:27 +03:00
- name: After success
if: success()
run: |
.travis/after_success.sh
env:
MATRIX_OS: ${{ matrix.os }}
2019-09-22 17:09:27 +03:00
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
2019-11-20 15:00:59 +03:00
2019-12-24 11:11:46 +03:00
- name: Prepare coverage token
if: success() && github.repository == 'python-pillow/Pillow'
run: cp .github/codecov-upstream.yml .codecov.yml
2019-11-20 15:00:59 +03:00
- name: Upload coverage
if: success()
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: ${{ matrix.os }} Python ${{ matrix.python-version }}