Skip to content

Commit

Permalink
Add code coverage
Browse files Browse the repository at this point in the history
Use pytest-cov and codecov to collect information about coverage and automatically generate reports in codecov.
  • Loading branch information
Mayitzin authored Nov 6, 2024
1 parent ab1636d commit 8fcb995
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest setuptools wheel build
pip install flake8 pytest pytest-cov setuptools wheel build
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install .
- name: Build binary wheel and source tarball
Expand All @@ -38,6 +38,10 @@ jobs:
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
- name: Test with pytest and collect coverage
run: |
pytest
pytest --cov --cov-report=xml
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit 8fcb995

Please sign in to comment.