Setup reports and upload codecov

Create coverage.xml, upload it to GitHub CI and visualize with codecov.

Setup instruction:
- Install codecov for project
  https://github.com/settings/installations/55029514
- Add CODECOV_TOKEN in the GitHub CI project secrets

Related #1097
This commit is contained in:
MattHag 2024-09-19 08:34:31 +02:00 committed by Peter F. Patel-Schneider
parent 454e1601bd
commit b1b9f01083
2 changed files with 21 additions and 2 deletions

View File

@ -31,6 +31,16 @@ jobs:
run: |
make test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.5.0
with:
directory: ./coverage/reports/
env_vars: OS, PYTHON
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
token: ${{ secrets.CODECOV_TOKEN }}
macos-tests:
runs-on: macos-latest
@ -55,4 +65,13 @@ jobs:
make install_pip PIP_ARGS='.["test"]'
- name: Run tests on macOS
run: |
export DYLD_LIBRARY_PATH=$(brew --prefix hidapi)/lib:$DYLD_LIBRARY_PATH && pytest --cov
export DYLD_LIBRARY_PATH=$(brew --prefix hidapi)/lib:$DYLD_LIBRARY_PATH && pytest --cov --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.5.0
with:
directory: ./coverage/reports/
env_vars: OS, PYTHON
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
token: ${{ secrets.CODECOV_TOKEN }}

View File

@ -66,4 +66,4 @@ lint:
test:
@echo "Running Solaar tests"
pytest --cov
pytest --cov --cov-report=xml