| name: Tests |
|
|
| on: |
| push: |
| pull_request: |
| release: |
| schedule: |
| |
| - cron: '0 1 * * 4' |
|
|
| jobs: |
|
|
| Tests: |
|
|
| continue-on-error: ${{ matrix.optional || false }} |
| runs-on: ${{ matrix.os || 'ubuntu-latest' }} |
| container: ${{ matrix.container }} |
| name: ${{ matrix.label || matrix.python-version }} ${{ startsWith(matrix.os, 'windows') && '(Windows)' || '' }} ${{ matrix.optional && '[OPTIONAL]' }} |
|
|
| strategy: |
| fail-fast: false |
| matrix: |
| python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] |
| test_quick: [1] |
|
|
| include: |
| - python-version: '3.12' |
| label: Linting |
| toxenv: docformatter_check,flake8,flake8_tests,isort_check,mypy,sphinx,pydocstyle,pylint,pylint_tests |
|
|
| - python-version: '3.13-dev' |
| optional: true |
| toxenv: py313 |
| toxpython: 3.13 |
|
|
| - python-version: '3.12' |
| test_keyboard: 1 |
| test_raw: 1 |
| test_quick: 0 |
|
|
| - python-version: '3.12' |
| os: windows-latest |
| test_quick: 0 |
|
|
| - python-version: '3.6' |
| os: ubuntu-20.04 |
| toxenv: py36 |
|
|
| - python-version: '3.5' |
| os: ubuntu-20.04 |
| toxenv: py35 |
|
|
| - python-version: '2.7' |
| container: {image: 'python:2.7.18-buster'} |
| toxenv: py27 |
| test_keyboard: 1 |
| test_raw: 1 |
| test_quick: 0 |
|
|
|
|
| env: |
| TOXENV: ${{ matrix.toxenv || format('py{0}', matrix.python-version) }} |
| TEST_QUICK: ${{ matrix.test_quick || 0 }} |
| TEST_KEYBOARD: ${{ matrix.test_keyboard || 0 }} |
| TEST_RAW: ${{ matrix.test_raw || 0 }} |
| TOXPYTHON: python${{ matrix.toxpython || matrix.python-version }} |
|
|
| steps: |
| - uses: actions/checkout@v4 |
|
|
| - 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' }} |
|
|
| |
| - 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: Collect terminal information |
| run: tox -e about |
|
|
| - name: Run tox |
| run: tox |
|
|
| - name: Upload to Codecov |
| if: ${{ matrix.label != 'linting' }} |
|
|
| uses: codecov/codecov-action@v3 |
| with: |
| verbose: true |
| name: ${{ matrix.label || matrix.python-version }} ${{ startsWith(matrix.os, 'windows') && '(Windows)' || '' }} |
| token: ${{ secrets.CODECOV_TOKEN }} |
| fail_ci_if_error: true |
| os: ${{ startsWith(matrix.os, 'windows') && 'windows' || 'linux' }} |
| env_vars: TOXENV,TEST_QUICK,TEST_KEYBOARD,TEST_RAW |
|
|