From ecfbc7b9fdfafb6c971017b734ef114413402895 Mon Sep 17 00:00:00 2001 From: Anton Larin Date: Tue, 15 Aug 2023 18:29:12 +0200 Subject: [PATCH] count coverage --- .github/workflows/pytest.yml | 20 ++++++++++++++++---- extensions/chatwoot/__init__.py | 0 extensions/discord/__init__.py | 0 scripts/__init__.py | 0 scripts/old/__init__.py | 0 scripts/parser/file/__init__.py | 0 scripts/parser/schema/__init__.py | 0 7 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 extensions/chatwoot/__init__.py create mode 100644 extensions/discord/__init__.py create mode 100644 scripts/__init__.py create mode 100644 scripts/old/__init__.py create mode 100644 scripts/parser/file/__init__.py create mode 100644 scripts/parser/schema/__init__.py diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 3ac87141..1dcd6662 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -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 diff --git a/extensions/chatwoot/__init__.py b/extensions/chatwoot/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/extensions/discord/__init__.py b/extensions/discord/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/scripts/__init__.py b/scripts/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/scripts/old/__init__.py b/scripts/old/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/scripts/parser/file/__init__.py b/scripts/parser/file/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/scripts/parser/schema/__init__.py b/scripts/parser/schema/__init__.py new file mode 100644 index 00000000..e69de29b