2020-11-20 10:06:27 +00:00
|
|
|
name: Test
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2021-02-18 15:39:52 +00:00
|
|
|
branches: [main]
|
2020-11-20 10:06:27 +00:00
|
|
|
pull_request:
|
2021-02-18 15:39:52 +00:00
|
|
|
branches: [main]
|
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:
|
2022-04-26 11:16:49 +01:00
|
|
|
- uses: actions/checkout@v3
|
2020-11-20 10:06:27 +00:00
|
|
|
- name: Set up Python 3.x
|
2022-04-26 11:16:49 +01:00
|
|
|
uses: actions/setup-python@v3
|
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 -e mypy,package_readme
|
|
|
|
|
|
|
|
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:
|
|
|
|
matrix:
|
2022-04-26 11:16:58 +01:00
|
|
|
python-version: ["3.7", "3.10"]
|
2020-11-20 10:06:27 +00:00
|
|
|
platform: [ubuntu-latest, macos-latest, windows-latest]
|
2022-04-26 11:16:58 +01:00
|
|
|
exclude: # 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.7
|
|
|
|
- platform: windows-latest
|
|
|
|
python-version: 3.7
|
|
|
|
steps:
|
2022-04-26 11:16:49 +01:00
|
|
|
- uses: actions/checkout@v3
|
2020-11-20 10:06:27 +00:00
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
2022-04-26 11:16:49 +01:00
|
|
|
uses: actions/setup-python@v3
|
2020-11-20 10:06:27 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install packages
|
|
|
|
run: pip install tox coverage
|
|
|
|
- name: Run Tox
|
|
|
|
run: tox -e py-cov
|
|
|
|
- name: Run Tox without lxml
|
|
|
|
run: tox -e py-cov-nolxml
|
|
|
|
- name: Produce coverage files
|
|
|
|
run: |
|
|
|
|
coverage combine
|
|
|
|
coverage xml
|
|
|
|
- name: Upload coverage to Codecov
|
2021-10-25 17:29:50 +02:00
|
|
|
uses: codecov/codecov-action@v2
|
2020-11-20 10:06:27 +00:00
|
|
|
with:
|
|
|
|
file: coverage.xml
|
|
|
|
flags: unittests
|
|
|
|
name: codecov-umbrella
|
|
|
|
fail_ci_if_error: true
|
|
|
|
|
|
|
|
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:
|
2022-04-26 11:16:49 +01:00
|
|
|
- uses: actions/checkout@v3
|
2020-11-20 10:06:27 +00:00
|
|
|
- name: Set up Python 3.x
|
2022-04-26 11:16:49 +01:00
|
|
|
uses: actions/setup-python@v3
|
2020-11-20 10:06:27 +00:00
|
|
|
with:
|
2022-04-26 11:19:28 +01:00
|
|
|
python-version: "3.10"
|
2020-11-20 10:06:27 +00:00
|
|
|
- name: Install packages
|
|
|
|
run: pip install tox
|
|
|
|
- name: Run Tox
|
|
|
|
run: tox -e py-cy-nolxml
|
|
|
|
|
|
|
|
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:
|
2022-04-26 11:16:49 +01:00
|
|
|
- uses: actions/checkout@v3
|
2020-11-20 10:06:27 +00:00
|
|
|
- name: Set up Python pypy3
|
2022-04-26 11:16:49 +01:00
|
|
|
uses: actions/setup-python@v3
|
2020-11-20 10:06:27 +00:00
|
|
|
with:
|
2021-09-27 14:37:20 +02:00
|
|
|
python-version: "pypy-3.7"
|
2020-11-20 10:06:27 +00:00
|
|
|
- name: Install packages
|
|
|
|
run: pip install tox
|
|
|
|
- name: Run Tox
|
|
|
|
run: tox -e pypy3-nolxml
|