Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

101 lines
2.9 KiB
YAML
Raw Normal View History

2020-11-20 10:06:27 +00:00
name: Test
on:
push:
branches: [main]
2020-11-20 10:06:27 +00:00
pull_request:
branches: [main]
2020-11-20 10:06:27 +00:00
permissions:
contents: read
env:
# turns off tox's output redirection so we can debug package installation
TOX_OPTIONS: -vv
2020-11-20 10:06:27 +00:00
jobs:
lint:
runs-on: ubuntu-latest
2020-12-16 11:56:09 +00:00
# https://github.community/t/github-actions-does-not-respect-skip-ci/17325/8
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
2020-11-20 10:06:27 +00:00
steps:
- uses: actions/checkout@v4
2020-11-20 10:06:27 +00:00
- name: Set up Python 3.x
uses: actions/setup-python@v5
2020-11-20 10:06:27 +00:00
with:
python-version: "3.x"
- name: Install packages
run: pip install tox
- name: Run Tox
run: tox $TOX_OPTIONS -e lint,package_readme
2020-11-20 10:06:27 +00:00
test:
runs-on: ${{ matrix.platform }}
2020-12-16 11:56:09 +00:00
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
2020-11-20 10:06:27 +00:00
strategy:
2023-09-15 21:55:37 +03:00
fail-fast: false
2020-11-20 10:06:27 +00:00
matrix:
# Oldest supported, 'Stable' supported, Newest supported
python-version: ["3.8", "3.12", "3.13"]
2023-09-15 21:55:37 +03:00
platform: [ubuntu-latest]
include: # Only test on the latest supported stable Python on macOS and Windows.
2020-11-20 10:06:27 +00:00
- platform: macos-latest
python-version: 3.12
2020-11-20 10:06:27 +00:00
- platform: windows-latest
python-version: 3.12
2020-11-20 10:06:27 +00:00
steps:
- uses: actions/checkout@v4
2020-11-20 10:06:27 +00:00
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
2020-11-20 10:06:27 +00:00
with:
python-version: ${{ matrix.python-version }}
2023-09-15 21:55:37 +03:00
allow-prereleases: true
2020-11-20 10:06:27 +00:00
- name: Install packages
run: pip install tox coverage
- name: Run Tox
run: tox $TOX_OPTIONS -e py-cov
- name: Run Tox without extra dependencies
run: tox $TOX_OPTIONS -e py-cov-noextra
2020-11-20 10:06:27 +00:00
- name: Produce coverage files
run: |
coverage combine
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
2020-11-20 10:06:27 +00:00
with:
file: coverage.xml
flags: unittests
name: codecov-umbrella
# TODO(anthrotype): Set fail_ci_if_error: true if/when Codecov becomes less flaky
fail_ci_if_error: false
# see https://github.com/codecov/codecov-action/issues/557
token: ${{ secrets.CODECOV_TOKEN }}
2020-11-20 10:06:27 +00:00
test-cython:
runs-on: ubuntu-latest
2020-12-16 11:56:09 +00:00
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
2020-11-20 10:06:27 +00:00
steps:
- uses: actions/checkout@v4
2020-11-20 10:06:27 +00:00
- name: Set up Python 3.x
uses: actions/setup-python@v5
2020-11-20 10:06:27 +00:00
with:
python-version: "3.11"
2020-11-20 10:06:27 +00:00
- name: Install packages
run: pip install tox
- name: Run Tox
run: tox $TOX_OPTIONS -e py-cy
2020-11-20 10:06:27 +00:00
test-pypy3:
runs-on: ubuntu-latest
2020-12-16 11:56:09 +00:00
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
2020-11-20 10:06:27 +00:00
steps:
- uses: actions/checkout@v4
2020-11-20 10:06:27 +00:00
- name: Set up Python pypy3
uses: actions/setup-python@v5
2020-11-20 10:06:27 +00:00
with:
python-version: "pypy-3.9"
2020-11-20 10:06:27 +00:00
- name: Install packages
run: pip install tox
- name: Run Tox
run: tox $TOX_OPTIONS -e pypy3