From 59fc66a15271e5567add8826765b6c1b5c2beca8 Mon Sep 17 00:00:00 2001 From: "stephen.worsley" Date: Tue, 23 Apr 2024 15:02:39 +0100 Subject: [PATCH] alternate approach for coverage --- .github/workflows/ci-tests.yml | 5 ++++- noxfile.py | 12 ++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 3a40cf2f..784e28db 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -94,6 +94,9 @@ jobs: - name: "tests (py${{ matrix.python-version }})" env: PY_VER: ${{ matrix.python-version }} - COVERAGE: ${{ matrix.coverage }} run: | nox --session tests -- --verbose + + - name: Upload coverage report + uses: codecov/codecov-action@v4 + if: ${{ matrix.coverage }} \ No newline at end of file diff --git a/noxfile.py b/noxfile.py index 71c515d8..118ebfd4 100644 --- a/noxfile.py +++ b/noxfile.py @@ -28,9 +28,6 @@ #: GHA-CI environment variable hook. PY_VER = os.environ.get("PY_VER", ["3.10", "3.11", "3.12"]) -#: GHA-CI environment variable hook. -COVERAGE = os.environ.get("COVERAGE", False) - #: GHA-CI environment variable hook. #: If you change the IRIS_SOURCE here you will also need to change it in #: the tests, wheel and benchmark workflows. @@ -305,13 +302,8 @@ def tests(session: nox.sessions.Session): # Install the esmf-regrid source in develop mode. session.install("--no-deps", "--editable", ".") - if COVERAGE: - # Execute the tests with code coverage. - session.run("pytest", "--cov-report=xml", "--cov") - session.run("codecov", "--required") - else: - # Execute the tests. - session.run("pytest") + # Execute the tests. + session.run("pytest") @nox.session