Skip to content

Commit

Permalink
ci(pytest): generate HTML coverage report for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman committed May 7, 2024
1 parent f6a4c63 commit bbf8b84
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@ jobs:
run: pip install -e toggl_py/[test]

- name: Run tests
run: coverage run -m pytest
run: tests/run.sh
working-directory: ./toggl_py

- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: toggl_py/tests/coverage

- name: Coverage comment
uses: py-cov-action/python-coverage-comment-action@v3
with:
Expand Down
10 changes: 10 additions & 0 deletions toggl_py/tests/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -eux

# run normal pytests
coverage run -m pytest

# clean out old coverage results
rm -rf docs/coverage

coverage html --directory docs/coverage

0 comments on commit bbf8b84

Please sign in to comment.