diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index 41da8cae1..fb72d470e 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -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 diff --git a/.gitignore b/.gitignore index b6e47617d..e62d491d2 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ htmlcov/ .cache nosetests.xml coverage.xml +coverage.html *.cover *.py,cover .hypothesis/ diff --git a/Makefile b/Makefile index 1ddc0260e..1746eb6a9 100644 --- a/Makefile +++ b/Makefile @@ -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