Skip to content

Commit

Permalink
alternate approach for coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenworsley committed Apr 23, 2024
1 parent 16f6267 commit 59fc66a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
12 changes: 2 additions & 10 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 59fc66a

Please sign in to comment.