From e2080a859caa0c4dc1f3af4f98a42913bbd7d3d7 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 8 Oct 2024 11:52:31 -0400 Subject: [PATCH] ci: try to get codecov working (#62) Signed-off-by: Henry Schreiner --- .github/codecov.yml | 4 ++++ .github/workflows/ci.yml | 5 +++++ noxfile.py | 1 + pyproject.toml | 5 ++++- 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .github/codecov.yml diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 0000000..f060a0a --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,4 @@ +comment: false +codecov: + notify: + after_n_builds: 8 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a8d7ef..3dac4bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,10 +57,15 @@ jobs: - name: Test package run: uvx nox -s coverage + - name: Prepare environment for codecov + run: uv tool install coverage + - name: Upload coverage report uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} + plugin: pycoverage + name: Python ${{ matrix.python-version}} dist: name: Distribution build diff --git a/noxfile.py b/noxfile.py index 873f6a5..21c4078 100644 --- a/noxfile.py +++ b/noxfile.py @@ -45,6 +45,7 @@ def coverage(session: nox.Session) -> None: session.posargs.extend( [ + "--cov", "--cov-config=pyproject.toml", "--cov-report=xml", "--cov-report=term-missing", diff --git a/pyproject.toml b/pyproject.toml index 89eb149..3b14d93 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,7 +72,10 @@ dev-dependencies = ["check-sdist[test]"] minversion = "6.0" addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"] xfail_strict = true -filterwarnings = ["error"] +filterwarnings = [ + "error", + "ignore:sys.monitoring isn't available:coverage.exceptions.CoverageWarning", +] log_cli_level = "INFO" testpaths = [ "tests",