From 12c48530fbf590ed37642068a1f41a3e51bb0e9a Mon Sep 17 00:00:00 2001 From: Naman Gera Date: Thu, 18 Jul 2024 14:35:16 +0100 Subject: [PATCH] CI: Add code coverage --- .github/workflows/tests_run.yml | 14 ++++++++++++-- codecov.yml | 8 ++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 codecov.yml diff --git a/.github/workflows/tests_run.yml b/.github/workflows/tests_run.yml index 12966660..73c28092 100644 --- a/.github/workflows/tests_run.yml +++ b/.github/workflows/tests_run.yml @@ -35,11 +35,21 @@ jobs: post-cleanup: 'all' init-shell: bash - - name: Install httomolibgpu + - name: Install httomolibgpu & coverage tools run: | + sudo yum install -y git pip install .[dev] + pip install coverage micromamba list - name: Run tests run: | - pytest tests/ + coverage run -m pytest tests/ + coverage xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + name: Code Coverage + fail_ci_if_error: true diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..7e4d2fbb --- /dev/null +++ b/codecov.yml @@ -0,0 +1,8 @@ +coverage: + status: + project: + default: + target: 90% +comment: + layout: "header, diff, flags, files" + behavior: default