Skip to content

Commit

Permalink
CI: Add code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
namannimmo10 committed Aug 15, 2024
1 parent 6ceae18 commit b58daf0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/tests_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand All @@ -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
8 changes: 8 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
coverage:
status:
project:
default:
target: 90%
comment:
layout: "header, diff, flags, files"
behavior: default

0 comments on commit b58daf0

Please sign in to comment.