From 0bf03f33e1de92a2893932335c89f9342546dde9 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 18 Sep 2025 18:32:08 -0500 Subject: [PATCH 1/5] Add coverage via codecov --- .github/workflows/tests.yml | 8 +++++++- pyproject.toml | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index da6d70e..3267977 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -38,4 +38,10 @@ jobs: - name: Test shell: bash - run: pytest -rs tests + run: pytest --cov --cov-branch --cov-report=xml -rs tests + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: openmc-dev/openmc_mcnp_adapter diff --git a/pyproject.toml b/pyproject.toml index 017efb2..dd5a130 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ classifiers = [ ] [project.optional-dependencies] -test = ["pytest"] +test = ["pytest", "pytest-cov"] [project.urls] "Bug Tracker" = "https://github.com/openmc-dev/openmc_mcnp_adapter/issues" From 868b5ea2413e71513ae6963c11166b745ee95e43 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 18 Sep 2025 18:36:00 -0500 Subject: [PATCH 2/5] Make sure curl is installed --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3267977..db9e5d7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,7 +23,7 @@ jobs: shell: bash run: | apt -y update - apt install -y python3-venv + apt install -y python3-venv curl python -m venv venv source venv/bin/activate From 2b50fc2e7d0ea36d7248f2e16805edee1eca934c Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 18 Sep 2025 18:38:04 -0500 Subject: [PATCH 3/5] Limit coverage to src/ --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index db9e5d7..380cb2e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -38,7 +38,7 @@ jobs: - name: Test shell: bash - run: pytest --cov --cov-branch --cov-report=xml -rs tests + run: pytest --cov=src --cov-branch --cov-report=xml -rs tests - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v5 From 58936abe8a0c6d43749f4307ea9d9a045af413a9 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 18 Sep 2025 18:42:47 -0500 Subject: [PATCH 4/5] Add __init__.py to tests dir --- tests/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/__init__.py diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 From 48a9fc3a79ed8328fdfcc0ca7fd69f17757814ac Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 18 Sep 2025 18:50:17 -0500 Subject: [PATCH 5/5] Try specifying package name in --cov= --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 380cb2e..ec7af40 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -38,7 +38,7 @@ jobs: - name: Test shell: bash - run: pytest --cov=src --cov-branch --cov-report=xml -rs tests + run: pytest --cov=openmc_mcnp_adapter --cov-branch --cov-report=xml -rs tests - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v5