diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index b850f60..60fdef9 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -28,7 +28,7 @@ jobs: run: | python -m pip install --upgrade setuptools python -m pip install --upgrade pip - python -m pip install flake8 pytest safety stix2 pytest-mock + python -m pip install flake8 pytest safety stix2 pytest-mock pytest-cov if [ -f requirements.txt ]; then pip install -r requirements.txt; fi python -m pip install . - name: Lint with flake8 @@ -39,5 +39,10 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Safety checks run: safety check - - name: Test with pytest - run: pytest + - name: Test with pytest and coverage + run: pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=mvt tests/ | tee pytest-coverage.txt + - name: Pytest coverage comment + uses: MishaKav/pytest-coverage-comment@main + with: + pytest-coverage-path: ./pytest-coverage.txt + junitxml-path: ./pytest.xml \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1249b00..766bd03 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,8 @@ coverage.xml *.py,cover .hypothesis/ .pytest_cache/ +pytest-coverage.txt +pytest.xml # Translations *.mo