Skip to content

Commit

Permalink
setup coverage and codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimevp54 committed Mar 2, 2021
1 parent deba83e commit 3b2a002
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
11 changes: 11 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[run]
branch = True
source = ./htmlBuilder/

[report]
exclude_lines =
if self.debug:
pragma: no cover
raise NotImplementedError
if __name__ == .__main__.:
ignore_errors = True
18 changes: 9 additions & 9 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@

name: Python package

on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]

on: [push, pull_request]
jobs:
build:

Expand All @@ -26,14 +21,19 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install flake8 pytest coverage
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
- name: Test and generate coverage report with pytest
run: |
pytest htmlBuilder/test.py
coverage run -m pytest htmlBuilder/test.py
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
verbose: true
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ pip-delete-this-directory.txt
.idea
use_examples.py
output.html
.pypirc
.pypirc
.coverage

0 comments on commit 3b2a002

Please sign in to comment.