From a44908aa590ddf00f94e18381af485c7c872ba5a Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Tue, 9 Aug 2022 19:46:58 -0400 Subject: [PATCH] [CI] Generate Python coverage data for Codecov --- .codecov.yml | 3 +++ .github/workflows/main.yml | 6 +++--- test/python/runCythonTests.py | 6 +++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index 5f9c5f6c8d..42559a8b18 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -7,3 +7,6 @@ coverage: comment: behavior: once require_changes: yes + +fixes: +- "build/python/::interfaces/cython/" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 047dce1f0d..f6cd216b5e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -155,7 +155,7 @@ jobs: run: python3 -m pip install -U pip setuptools wheel - name: Install Python dependencies run: python3 -m pip install ruamel.yaml scons numpy cython h5py pandas scipy pytest - pytest-github-actions-annotate-failures gcovr + pytest-github-actions-annotate-failures pytest-cov gcovr - name: Build Cantera run: | python3 `which scons` build blas_lapack_libs=lapack,blas coverage=y \ @@ -177,10 +177,10 @@ jobs: path: htmlcoverage* retention-days: 5 - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 with: verbose: true - files: ./coverage.xml + files: ./coverage.xml,./build/pycov.xml fail_ci_if_error: true example-keywords: diff --git a/test/python/runCythonTests.py b/test/python/runCythonTests.py index 206fc54a5f..8af27670fc 100644 --- a/test/python/runCythonTests.py +++ b/test/python/runCythonTests.py @@ -89,7 +89,11 @@ if fast_fail: pytest_args.insert(0, "-x") if coverage: - pytest_args.extend(["--cov=cantera", "--cov-config=test/python/coverage.ini"]) + pytest_args.extend([ + "--cov=cantera", + "--cov-config=test/python/coverage.ini", + "--cov-report=xml:build/pycov.xml" + ]) if verbose: pytest_args.insert(0, "-v") else: