From 232815d68e949d9b909b2b190212e081fd945211 Mon Sep 17 00:00:00 2001 From: Sebastian Hoffmann Date: Mon, 6 Jan 2025 14:12:56 +0100 Subject: [PATCH] ci: test coverage, closes #35 --- .github/workflows/run_tests.yml | 15 ++++++++++++--- ci_requirements.txt | 1 + requirements.txt | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 8a7f6d4..aaa89bc 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -36,6 +36,15 @@ jobs: run: | pip install . - - name: Run Tests - run: - pytest --no-header -v test + - name: Run tests & coverage + run: | + coverage run -m pytest --no-header -v test + coverage report -m -i + coverage html -i + + - name: Archive coverage results + if: runner.os == 'ubuntu-latest' + uses: actions/upload-artifact@v4 + with: + name: code-coverage-report + path: htmlcov diff --git a/ci_requirements.txt b/ci_requirements.txt index 775d288..c148804 100644 --- a/ci_requirements.txt +++ b/ci_requirements.txt @@ -6,3 +6,4 @@ pre-commit pytest sphinx sphinx-rtd-theme +coverage diff --git a/requirements.txt b/requirements.txt index ea75ee0..110784f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,4 @@ xarray progress_table>=2.2.0 omegaconf torchmetrics -nvidia-ml-py \ No newline at end of file +nvidia-ml-py