diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml new file mode 100644 index 00000000..e5a7a0eb --- /dev/null +++ b/.github/workflows/coverage.yaml @@ -0,0 +1,22 @@ +name: Coverage +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + report: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: 3.11 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install tox + - name: Check Coverage + run: tox -e coverage \ No newline at end of file diff --git a/tox.ini b/tox.ini index 14dd1d71..41a10763 100644 --- a/tox.ini +++ b/tox.ini @@ -37,3 +37,18 @@ deps = twine commands = twine check dist/* skip_install = True + +[testenv:coverage] +description = report unit test coverage +deps = + coverage + pytest + genbadge[coverage] +commands = + coverage run \ + --omit=*/_version.py,*/launch_training.py \ + --source=tuning,build \ + --module pytest tests/ + coverage report -m + coverage xml + genbadge coverage -s -i coverage.xml