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