Skip to content

Commit

Permalink
Add coverage automation
Browse files Browse the repository at this point in the history
Update unit tests to get accurate coverage reports
  • Loading branch information
NeonDaniel committed Jul 19, 2023
1 parent 3682cb4 commit d7bbd96
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
44 changes: 44 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Run CodeCov
on:
push:
branches:
- dev
workflow_dispatch:

jobs:
run:
runs-on: ubuntu-latest
env:
PYTHON: '3.9'
steps:
- uses: actions/checkout@master
- name: Setup Python
uses: actions/setup-python@master
with:
python-version: 3.9
- name: Install System Dependencies
run: |
sudo apt-get update
sudo apt install python3-dev
python -m pip install build wheel
- name: Install repo
run: |
pip install -e .[mycroft,deprecated]
- name: Install test dependencies
run: |
sudo apt install libssl-dev libfann-dev portaudio19-dev libpulse-dev
pip install -r requirements/tests.txt
pip install ./test/unittests/common_query/ovos_tskill_fakewiki
- name: Generate coverage report
run: |
pytest --cov=./ovos_core --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/reports/
fail_ci_if_error: true
files: ./coverage.xml,!./cache
flags: unittests
name: codecov-umbrella
verbose: true
3 changes: 2 additions & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
python -m pip install build wheel
- name: Install core repo
run: |
pip install .[mycroft,deprecated]
pip install -e .[mycroft,deprecated]
- name: Install test dependencies
run: |
pip install -r requirements/tests.txt
Expand All @@ -68,6 +68,7 @@ jobs:
# or they will overwrite previous invocations' coverage reports
# (for an example, see OVOS Skill Manager's workflow)
- name: Upload coverage
if: "${{ matrix.python-version == '3.9' }}"
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
uses: codecov/codecov-action@v2
Expand Down

0 comments on commit d7bbd96

Please sign in to comment.