From b58daf0f603760a5635ab3628b7c5a38cd14f495 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 | 16 +++++++++++++--- codecov.yml | 8 ++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 codecov.yml diff --git a/.github/workflows/tests_run.yml b/.github/workflows/tests_run.yml index 65634c03..f03bc5eb 100644 --- a/.github/workflows/tests_run.yml +++ b/.github/workflows/tests_run.yml @@ -12,7 +12,7 @@ jobs: build-linux: runs-on: iris-gpu container: - image: nvidia/cuda:11.6.2-devel-ubi8 + image: ghcr.io/diamondlightsource/httomolibgpu:dockerfile env: NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }} @@ -32,11 +32,21 @@ jobs: post-cleanup: 'all' init-shell: bash - - name: Install httomolibgpu + - name: Install httomolibgpu & coverage tools run: | pip install .[dev] + pip install coverage micromamba list - name: Run tests run: | - pytest tests/ + coverage run -m pytest tests/ + coverage xml -o /home/runner/coverage.xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: /home/runner/coverage.xml + fail_ci_if_error: true + verbose: 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