2021-12-10 17:01:56 +08:00
|
|
|
name: Code Coverage
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
name: Run Pytest and Upload Coverage
|
2022-01-13 17:58:35 +08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
python: ["pypy-3.7", "3.7", "pypy-3.8", "3.8", "3.9", "3.10"]
|
|
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
|
|
fail-fast: false
|
|
|
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
2021-12-10 17:01:56 +08:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2022-01-13 16:41:01 +08:00
|
|
|
- name: Setup Python environment
|
|
|
|
uses: ./.github/actions/setup-python
|
2022-01-13 17:58:35 +08:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python }}
|
2021-12-20 10:10:22 +08:00
|
|
|
|
|
|
|
- name: Run Pytest
|
2021-12-10 17:01:56 +08:00
|
|
|
run: |
|
|
|
|
cd tests/
|
2022-01-10 11:53:02 +08:00
|
|
|
poetry run pytest -n auto --cov-report xml
|
2021-12-10 17:01:56 +08:00
|
|
|
|
|
|
|
- name: Upload coverage report
|
|
|
|
uses: codecov/codecov-action@v2
|
|
|
|
with:
|
|
|
|
files: ./tests/coverage.xml
|
|
|
|
flags: unittests
|