From dee5b120ab6bfcee1b73a8e35eff99bec9580e9d Mon Sep 17 00:00:00 2001 From: Davide Laghi Date: Thu, 8 Aug 2024 16:23:58 +0200 Subject: [PATCH 1/3] connect codecov --- .github/workflows/pytest.yml | 26 +++++++++++--------------- README.md | 1 + 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 1a9f55f6..3367abab 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -57,7 +57,7 @@ jobs: run: | set -o pipefail source /usr/local/Modules/init/sh - pytest --cov=. --cov-report html -cov-config=jade.coveragerc | tee pytest_output.log + pytest --cov=. --cov-report html -cov-config=jade.coveragerc --cov-report xml env: ACCESS_TOKEN_GITHUB: ${{ secrets.ACCESS_TOKEN_GITHUB }} @@ -65,20 +65,16 @@ jobs: - name: Testing - Windows if: runner.os == 'Windows' run: | - pytest --cov=. --cov-report html -cov-config="jade.coveragerc" | tee pytest_output.log + pytest env: ACCESS_TOKEN_GITHUB: ${{ secrets.ACCESS_TOKEN_GITHUB }} - - - name: Archive test results - if: always() - uses: actions/upload-artifact@v4 - with: - name: pytest_output_${{matrix.os}}_${{matrix.python-version}}.log - path: pytest_output.log - - - name: Archive test coverage - if: always() - uses: actions/upload-artifact@v4 + + # Upload coverage to Codecov. Do it only for one case of the matrix. + - name: Upload coverage to Codecov + # do it only once for python 3.10 + if: matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest' + uses: codecov/codecov-action@v4 with: - name: htmlcov${{matrix.os}}_${{matrix.python-version}} - path: htmlcov/ + verbose: true + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.md b/README.md index 04278625..126d9156 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ [![Testing](https://github.com/JADE-V-V/JADE/actions/workflows/pytest.yml/badge.svg?branch=master)](https://github.com/JADE-V-V/JADE/actions/workflows/pytest.yml) [![Documentation Status](https://readthedocs.org/projects/jade-a-nuclear-data-libraries-vv-tool/badge/?version=latest)](https://jade-a-nuclear-data-libraries-vv-tool.readthedocs.io/en/latest/?badge=latest) +[![codecov](https://codecov.io/gh/JADE-V-V/JADE/graph/badge.svg?token=C0Q75M9FVH)](https://codecov.io/gh/JADE-V-V/JADE) From fb285e2314600c52dd8be9d43470e61b82ef8aeb Mon Sep 17 00:00:00 2001 From: Davide Laghi Date: Thu, 8 Aug 2024 16:43:40 +0200 Subject: [PATCH 2/3] fix coverage config --- jade.coveragerc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jade.coveragerc b/jade.coveragerc index 3e0cf723..a2eccb31 100644 --- a/jade.coveragerc +++ b/jade.coveragerc @@ -2,9 +2,9 @@ [run] omit = # No need to cover the test files - tests/* + */tests/* # The following are not developed directly by JADE - MCTAL_READER2.py - xsdirpyne.py + */MCTAL_READER2.py + */xsdirpyne.py [html] show_contexts = True \ No newline at end of file From b211844d20dcedc8ddf477567608e7a63af7b73d Mon Sep 17 00:00:00 2001 From: Davide Laghi Date: Thu, 8 Aug 2024 17:42:16 +0200 Subject: [PATCH 3/3] try ignore tests --- .github/workflows/pytest.yml | 2 +- codecov.yml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 codecov.yml diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 3367abab..c9ae67f5 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -57,7 +57,7 @@ jobs: run: | set -o pipefail source /usr/local/Modules/init/sh - pytest --cov=. --cov-report html -cov-config=jade.coveragerc --cov-report xml + pytest --cov=. -cov-config=jade.coveragerc --cov-report xml env: ACCESS_TOKEN_GITHUB: ${{ secrets.ACCESS_TOKEN_GITHUB }} diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..8e060694 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,3 @@ +# sample regex patterns +ignore: + - "tests" # ignore folders and all its contents \ No newline at end of file