diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9193541d..154ea595 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -24,3 +24,14 @@ jobs: pip install -r requirements-developer.txt - name: Run Pre commit hook (formatting, linting & tests) run: pre-commit run --all-files --hook-stage pre-push --show-diff-on-failure + + - name: Build coverage file + run: | + pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=choice_learn tests/ | tee pytest-coverage.txt + + - name: Pytest coverage comment + uses: MishaKav/pytest-coverage-comment@main + with: + pytest-coverage-path: ./pytest-coverage.txt + junitxml-path: ./pytest.xml + issue-number: 101 diff --git a/.github/workflows/pr_ci.yaml b/.github/workflows/pr_ci.yaml index 62af8191..28478308 100644 --- a/.github/workflows/pr_ci.yaml +++ b/.github/workflows/pr_ci.yaml @@ -34,3 +34,4 @@ jobs: with: pytest-coverage-path: ./pytest-coverage.txt junitxml-path: ./pytest.xml + report-only-changed-files: true diff --git a/tests/manual_run.py b/tests/manual_run.py index d927c552..48ef1ae2 100644 --- a/tests/manual_run.py +++ b/tests/manual_run.py @@ -1,4 +1,5 @@ """Runs manually all test_* functions.""" + import importlib from pathlib import Path