Skip to content

add coverage reporting #17

add coverage reporting

add coverage reporting #17

Workflow file for this run

name: "Unit tests"
on:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- "[0-9]+.[0-9]+.[0-9]+"
schedule:
# Weekly on saturday 23:59
- cron: "59 23 * * 6"
jobs:
test_suite:
runs-on: [self-hosted, linux, x64, gpu]
container:
image: continuumio/miniconda3
options: --runtime=nvidia --gpus all
steps:
- name: Pull code
uses: actions/checkout@v4
- name: Install dependencies
run: |
conda install -y -c conda-forge python=3 cupy cuda-version=11.8
python -m pip install coverage
- name: Install code and list dependencies
run: |
python -m pip install .[plotting]
conda list
- name: Run tests and generate coverage
run: |
cd tests
coverage run -m unittest discover
coverage xml coverage.xml
- name: upload coverage report
uses: actions/upload-artifact@v4
with:
path: tests/coverage.xml
name: coverage
report-coverage:
if: ${{ github.event_name == 'pull_request' }}
needs: [test_suite]
runs-on: [self-hosted, linux, x64, gpu]
container:
image: ubuntu
permissions:
pull-requests: write
steps:
- name: download artifact
uses: actions/download-artifact@v4
with:
name: coverage
- name: Get Coverage
uses: orgoro/[email protected]
with:
coverageFile: coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}