Skip to content

Commit 52f3c23

Browse files
authored
Merge pull request #140 from DiamondLightSource/codecov
CI: Add code coverage
2 parents d7090ec + b6e2d2f commit 52f3c23

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

.github/workflows/httomolibgpu_tests_run_iris.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
iris-gpu:
99
runs-on: iris-gpu
1010
container:
11-
image: nvidia/cuda:12.6.3-devel-ubi8
11+
image: ghcr.io/diamondlightsource/httomolibgpu:dockerfile
1212
env:
1313
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }}
1414
options: --gpus all --runtime=nvidia
@@ -22,18 +22,26 @@ jobs:
2222
uses: actions/checkout@v4
2323

2424
- name: Create conda environment
25-
uses: mamba-org/setup-micromamba@v1
25+
uses: mamba-org/setup-micromamba@v2
2626
with:
2727
environment-file: conda/environment.yml
2828
environment-name: httomo
2929
post-cleanup: 'all'
3030
init-shell: bash
3131

32-
- name: Install httomolibgpu
32+
- name: Install httomolibgpu & coverage tools
3333
run: |
3434
pip install .[dev]
35+
pip install coverage
3536
micromamba list
3637
37-
- name: Run unit tests on small data
38+
- name: Run tests with coverage
3839
run: |
39-
pytest tests/
40+
pytest --cov=./ tests/ --cov-report=xml:/home/runner/coverage.xml
41+
42+
- name: Upload coverage to Codecov
43+
run: |
44+
pip install codecov-cli
45+
codecovcli -v upload-coverage --fail-on-error --file /home/runner/coverage.xml --name httomolibgpu-codecov
46+
env:
47+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

codecov.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
target: 90%
6+
comment:
7+
layout: "header, diff, flags, files"
8+
behavior: default

0 commit comments

Comments
 (0)