Skip to content

add code coverage CI job #13

add code coverage CI job

add code coverage CI job #13

Workflow file for this run

name: Code Coverage
on: [push, pull_request]
jobs:
code-coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python setup.py install
pip install coverage pytest pytest-cov
- name: Run tests and collect coverage
run: |
cd tests
pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,PYTHON
fail_ci_if_error: true
verbose: true