Pillow/.github/workflows/test.yml

118 lines
2.8 KiB
YAML
Raw Normal View History

2019-09-22 17:09:27 +03:00
name: Test
on: [push, pull_request, workflow_dispatch]
2019-09-22 17:09:27 +03:00
jobs:
build:
strategy:
fail-fast: false
2019-09-22 17:09:27 +03:00
matrix:
2019-09-22 23:09:59 +03:00
os: [
"macos-latest",
"ubuntu-latest",
2019-09-22 23:09:59 +03:00
]
2019-09-22 17:09:27 +03:00
python-version: [
2021-10-18 10:16:29 +03:00
"pypy-3.8",
2020-12-17 18:23:12 +03:00
"pypy-3.7",
2022-04-28 21:28:46 +03:00
"3.11-dev",
"3.10",
2020-10-06 17:28:42 +03:00
"3.9",
2019-11-04 23:55:50 +03:00
"3.8",
2019-09-22 17:09:27 +03:00
"3.7",
]
include:
2021-10-18 10:14:18 +03:00
- python-version: "3.7"
2020-11-03 18:31:59 +03:00
PYTHONOPTIMIZE: 1
2021-06-14 15:58:40 +03:00
REVERSE: "--reverse"
2021-10-18 10:14:18 +03:00
- python-version: "3.8"
2020-11-03 18:31:59 +03:00
PYTHONOPTIMIZE: 2
# Include new variables for Codecov
- os: ubuntu-latest
codecov-flag: GHA_Ubuntu
- os: macos-latest
codecov-flag: GHA_macOS
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@v3
2019-09-22 17:09:27 +03:00
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
2019-11-04 10:06:09 +03:00
with:
python-version: ${{ matrix.python-version }}
2021-11-18 14:42:41 +03:00
cache: pip
cache-dependency-path: ".ci/*.sh"
2019-11-04 10:06:09 +03:00
- name: Build system information
2021-01-06 14:42:31 +03:00
run: python3 .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: |
.ci/install.sh
env:
GHA_PYTHON_VERSION: ${{ matrix.python-version }}
2019-09-22 17:09:27 +03:00
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
2022-04-28 21:28:46 +03:00
env:
GHA_PYTHON_VERSION: ${{ matrix.python-version }}
2019-09-22 23:09:59 +03:00
- name: Build
run: |
.ci/build.sh
2019-09-22 17:09:27 +03:00
- name: Test
2020-11-04 16:58:33 +03:00
run: |
2021-06-14 15:58:40 +03:00
if [ $REVERSE ]; then
python3 -m pip install pytest-reverse
fi
2020-11-04 16:58:33 +03:00
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh
else
.ci/test.sh
fi
2020-11-03 18:31:59 +03:00
env:
PYTHONOPTIMIZE: ${{ matrix.PYTHONOPTIMIZE }}
2021-06-14 15:58:40 +03:00
REVERSE: ${{ matrix.REVERSE }}
2019-09-22 17:09:27 +03:00
- name: Prepare to upload errors
if: failure()
run: |
mkdir -p Tests/errors
2019-10-12 13:59:03 +03:00
- name: Upload errors
uses: actions/upload-artifact@v3
2019-10-12 13:59:03 +03:00
if: failure()
with:
name: errors
path: Tests/errors
- name: Docs
2022-03-01 01:19:04 +03:00
if: startsWith(matrix.os, 'ubuntu') && matrix.python-version == 3.10
run: |
python3 -m pip install furo sphinx-copybutton sphinx-issues sphinx-removed-in sphinxext-opengraph
make doccheck
2019-09-22 17:09:27 +03:00
- name: After success
run: |
.ci/after_success.sh
2019-11-20 15:00:59 +03:00
- name: Upload coverage
run: bash <(curl -s https://codecov.io/bash) -F ${{ matrix.codecov-flag }}
env:
CODECOV_NAME: ${{ matrix.os }} Python ${{ matrix.python-version }}
success:
needs: build
runs-on: ubuntu-latest
name: Test Successful
steps:
- name: Success
run: echo Test Successful