Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Add code coverage #140

Merged
merged 3 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions .github/workflows/httomolibgpu_tests_run_iris.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
iris-gpu:
runs-on: iris-gpu
container:
image: nvidia/cuda:12.6.3-devel-ubi8
image: ghcr.io/diamondlightsource/httomolibgpu:dockerfile
env:
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }}
options: --gpus all --runtime=nvidia
Expand All @@ -22,18 +22,26 @@ jobs:
uses: actions/checkout@v4

- name: Create conda environment
uses: mamba-org/setup-micromamba@v1
uses: mamba-org/setup-micromamba@v2
with:
environment-file: conda/environment.yml
environment-name: httomo
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 unit tests on small data
- name: Run tests with coverage
run: |
pytest tests/
pytest --cov=./ tests/ --cov-report=xml:/home/runner/coverage.xml
- name: Upload coverage to Codecov
run: |
pip install codecov-cli
codecovcli -v upload-coverage --fail-on-error --file /home/runner/coverage.xml --name httomolibgpu-codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
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
Loading