diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ef8e54f..f48a79c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,11 +15,16 @@ jobs: uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e #v6.8.0 - name: setup repo run: just setup + - name: run linting + run: just lint - name: run tests with test info run: just coverage xml - name: Upload coverage reports to Codecov uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 #v5.5.1 with: token: ${{ secrets.CODECOV_TOKEN }} - - name: run linting - run: just lint + - name: Upload test results to Codecov + if: ${{ !cancelled() }} + uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f #v1.1.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/Justfile b/Justfile index d9695fd..c281a7d 100644 --- a/Justfile +++ b/Justfile @@ -9,10 +9,9 @@ setup: test file='': uv run pytest -x --pdb --pdbcls=IPython.terminal.debugger:TerminalPdb {{file}} -# Compute test coverage information (formats: report, html, xml) -coverage format='report': - uv run coverage run --branch -m pytest - uv run coverage {{format}} --omit=tests/**/*.py +# Compute test coverage information (formats: term, html, xml) +coverage format='term': + uv run pytest --cov=bough --cov-branch --cov-report={{format}} --junitxml=junit.xml -o junit_family=legacy # Run linters and formatters lint: diff --git a/pyproject.toml b/pyproject.toml index 3afde3d..0aaeffe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,9 +25,9 @@ source = "vcs" [dependency-groups] dev = [ - "coverage>=7.11.0", "ipdb>=0.13.13", "pytest>=8.4.1", + "pytest-cov>=7.0.0", "ruff>=0.12.11", "tomli-w>=1.0.0", "ty>=0.0.1a25", diff --git a/uv.lock b/uv.lock index b8efd7a..92f0e8e 100644 --- a/uv.lock +++ b/uv.lock @@ -12,7 +12,7 @@ wheels = [ [[package]] name = "bough" -version = "0.2.2.dev7+gfa9a85b30.d20251102" +version = "0.2.2.dev4+g48476bd3f.d20251102" source = { editable = "." } dependencies = [ { name = "gitpython" }, @@ -22,9 +22,9 @@ dependencies = [ [package.dev-dependencies] dev = [ - { name = "coverage" }, { name = "ipdb" }, { name = "pytest" }, + { name = "pytest-cov" }, { name = "ruff" }, { name = "tomli-w" }, { name = "ty" }, @@ -39,9 +39,9 @@ requires-dist = [ [package.metadata.requires-dev] dev = [ - { name = "coverage", specifier = ">=7.11.0" }, { name = "ipdb", specifier = ">=0.13.13" }, { name = "pytest", specifier = ">=8.4.1" }, + { name = "pytest-cov", specifier = ">=7.0.0" }, { name = "ruff", specifier = ">=0.12.11" }, { name = "tomli-w", specifier = ">=1.0.0" }, { name = "ty", specifier = ">=0.0.1a25" }, @@ -345,6 +345,20 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/29/16/c8a903f4c4dffe7a12843191437d7cd8e32751d5de349d45d3fe69544e87/pytest-8.4.1-py3-none-any.whl", hash = "sha256:539c70ba6fcead8e78eebbf1115e8b589e7565830d7d006a8723f19ac8a0afb7", size = 365474 }, ] +[[package]] +name = "pytest-cov" +version = "7.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "coverage" }, + { name = "pluggy" }, + { name = "pytest" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/5e/f7/c933acc76f5208b3b00089573cf6a2bc26dc80a8aece8f52bb7d6b1855ca/pytest_cov-7.0.0.tar.gz", hash = "sha256:33c97eda2e049a0c5298e91f519302a1334c26ac65c1a483d6206fd458361af1", size = 54328 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ee/49/1377b49de7d0c1ce41292161ea0f721913fa8722c19fb9c1e3aa0367eecb/pytest_cov-7.0.0-py3-none-any.whl", hash = "sha256:3b8e9558b16cc1479da72058bdecf8073661c7f57f7d3c5f22a1c23507f2d861", size = 22424 }, +] + [[package]] name = "pyyaml" version = "6.0.2"