Merge pull request #304 from larinam/pytest-introduction

count test coverage
This commit is contained in:
Alex 2023-08-17 16:17:57 +01:00 committed by GitHub
commit 12ac20ec43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 4 deletions

View File

@ -3,8 +3,11 @@ name: Run python tests with pytest
on: [push, pull_request]
jobs:
build:
pytest_and_coverage:
name: Run tests and count coverage
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
strategy:
matrix:
@ -19,9 +22,18 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install pytest pytest-cov
cd application
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
python -m pytest
python -m pytest --cov=application --cov=scripts --cov=extensions --cov-report xml:/tmp/coverage.xml
- name: Coverage
if: github.event_name == 'pull_request' && matrix.python-version == '3.11'
uses: orgoro/coverage@v3
with:
coverageFile: /tmp/coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
thresholdAll: 0.1
thresholdNew: 0.01
thresholdModified: 0.01

View File

View File

0
scripts/__init__.py Normal file
View File

0
scripts/old/__init__.py Normal file
View File

View File

View File