Skip to content

Commit

Permalink
Check code coverage during CI workflow run
Browse files Browse the repository at this point in the history
  • Loading branch information
per1234 committed Sep 1, 2020
1 parent 415b7e9 commit b70d7b3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/libraries_compile-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ jobs:
pip install --quiet pep8-naming
flake8 --config "$GITHUB_WORKSPACE/libraries/compile-examples/compilesketches/.flake8" --show-source "$GITHUB_WORKSPACE/libraries/compile-examples/compilesketches"
- name: Run Python unit tests
- name: Run Python unit tests and report code coverage
run: |
export PYTHONPATH="$GITHUB_WORKSPACE/libraries/compile-examples/compilesketches"
pytest "$GITHUB_WORKSPACE/libraries/compile-examples/compilesketches/tests"
coverage run --source="$GITHUB_WORKSPACE/libraries/compile-examples/compilesketches" --module pytest "$GITHUB_WORKSPACE/libraries/compile-examples/compilesketches/tests"
# Display code coverage report in workflow run log
coverage report
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
6 changes: 6 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
coverage:
range: "100...100"
status:
project:
default:
threshold: 0%
1 change: 1 addition & 0 deletions compilesketches/tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
--requirement ../requirements.txt
coverage==5.2.1
pytest==5.4.2
pytest-mock==3.1.0

0 comments on commit b70d7b3

Please sign in to comment.