Tests #260
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
pull_request: | |
release: | |
schedule: | |
# Every Thursday at 1 AM | |
- cron: '0 1 * * 4' | |
jobs: | |
Tests: | |
runs-on: ${{ matrix.os || 'ubuntu-latest' }} | |
container: ${{ matrix.container }} | |
name: ${{ (matrix.toxenv && !startsWith(matrix.toxenv, 'py')) && format('{0} ({1})', matrix.toxenv, matrix.python-version) || matrix.python-version }} ${{ matrix.optional && '[OPTIONAL]' }} | |
continue-on-error: ${{ matrix.optional || false }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] | |
include: | |
- python-version: '3.12' | |
toxenv: lint | |
- python-version: '3.12' | |
toxenv: docs | |
- python-version: '3.12' | |
toxenv: coverage | |
- python-version: '3.13-dev' | |
optional: true | |
toxenv: py313 | |
toxpython: '3.13' | |
- python-version: '3.6' | |
toxenv: py36 | |
os: ubuntu-20.04 | |
- python-version: '3.5' | |
toxenv: py35 | |
os: ubuntu-20.04 | |
- python-version: '2.7' | |
container: {image: 'python:2.7.18-buster'} | |
toxenv: py27 | |
- python-version: '2.7' | |
container: {image: 'python:2.7.18-buster'} | |
toxenv: el7 | |
- python-version: pypy-2.7 | |
toxenv: pypy27 | |
- python-version: pypy-3.10 | |
toxenv: pypy310 | |
env: | |
TOXENV: ${{ matrix.toxenv || format('py{0}', matrix.python-version) }} | |
TOXPYTHON: python${{ matrix.toxpython || matrix.python-version }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
if: ${{ matrix.python-version != '2.7' && matrix.python-version != '3.5' }} | |
# Workaround for https://github.com/actions/setup-python/issues/866 | |
- name: Set up Python 3.5 (Workaround) | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.5 | |
env: | |
PIP_TRUSTED_HOST: "pypi.python.org pypi.org files.pythonhosted.org" | |
if: ${{ matrix.python-version == '3.5' }} | |
- name: Install tox | |
run: pip install tox | |
- name: Run tox | |
run: tox -- --verbose | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
if: ${{ matrix.toxenv == 'coverage' }} |