build(tests): add tests and coverage to CI workflow

#refs 15
This commit is contained in:
Arthur Meyre
2021-07-15 18:57:28 +02:00
parent a2185af578
commit 7dccfa649c
3 changed files with 23 additions and 1 deletions

View File

@@ -15,6 +15,8 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
@@ -43,12 +45,27 @@ jobs:
if: ${{ success() && !cancelled() }}
run: |
make pcc
- name: PyTest
if: ${{ steps.conformance.outcome == 'success' && !cancelled() }}
run: |
make pytest
- name: Test coverage
if: ${{ success() && !cancelled() }}
run: |
poetry run diff-cover coverage.xml --fail-under 100 --html-report coverage.html --compare-branch origin/${{ github.base_ref }}
- name: Archive test coverage
uses: actions/upload-artifact@v2
if: ${{ success() && !cancelled() }}
with:
name: coverage
path: coverage.html
- name: Build docs
id: docs
if: ${{ success() && !cancelled() }}
if: ${{ steps.conformance.outcome == 'success' && !cancelled() }}
run: |
make docs
- name: Archive docs artifacts
if: ${{ steps.docs.outcome == 'success' && !cancelled() }}
uses: actions/upload-artifact@v2
with:
name: html-docs

1
.gitignore vendored
View File

@@ -46,6 +46,7 @@ htmlcov/
.cache
nosetests.xml
coverage.xml
coverage.html
*.cover
*.py,cover
.hypothesis/

View File

@@ -26,6 +26,10 @@ conformance: python_format
pcc: check_python_format pylint
.PHONY: pcc
pytest:
poetry run pytest --cov=hdk -vv --cov-report=xml tests/
.PHONY: pytest
docs:
cd docs && poetry run make html
.PHONY: docs