From dddad0a48bd1ba81424c21ea4bfbe37f0a0aadf4 Mon Sep 17 00:00:00 2001 From: 4444jPPP Date: Sat, 21 Mar 2026 23:52:10 -0400 Subject: [PATCH] feat: add Codecov integration for test coverage reporting Add pytest-cov to CI workflow and upload coverage reports to Codecov. Includes codecov.yml config with 80% patch target and auto project target with 5% threshold. Resolves #1 Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/python-package-conda.yml | 14 ++++++++++++-- codecov.yml | 17 +++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 codecov.yml diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index a280257..6cad05a 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -31,7 +31,17 @@ jobs: poetry run ruff --format=github --target-version=py310 . continue-on-error: true - - name: Test with pytest + - name: Test with pytest and coverage run: | poetry install --with dev - poetry run pytest -v -s + poetry run pip install pytest-cov + poetry run pytest -v -s --cov=ipapi --cov-report=xml + + - name: Upload coverage to Codecov + if: matrix.python-version == '3.10' + uses: codecov/codecov-action@v4 + with: + file: ./coverage.xml + fail_ci_on_error: false + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..7244fea --- /dev/null +++ b/codecov.yml @@ -0,0 +1,17 @@ +codecov: + require_ci_to_pass: true + +coverage: + status: + project: + default: + target: auto + threshold: 5% + patch: + default: + target: 80% + +comment: + layout: "reach,diff,flags,files" + behavior: default + require_changes: false