Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
branches:
- main
- dev
- demo
- hotfix
pull_request:
types:
Expand All @@ -14,12 +13,15 @@ on:
- reopened
- synchronize
branches:
- main
- main
- dev
- demo
- hotfix

permissions:
contents: read
actions: read
pull-requests: write

jobs:
test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -48,11 +50,31 @@ jobs:
echo "Test files found, running tests."
echo "skip_tests=false" >> $GITHUB_ENV
fi

- name: Run tests with coverage
if: env.skip_tests == 'false'
run: |
pytest --cov=. --cov-report=term-missing --cov-report=xml --ignore=tests/e2e-test/tests

cat > .coveragerc << 'EOF'
[run]
source = src/backend
omit =
*/tests/*
*/test_*
EOF
pytest --cov --cov-config=.coveragerc --cov-report=term-missing --cov-report=xml --junitxml=pytest.xml --ignore=tests/e2e-test/tests

- name: Pytest Coverage Comment
if: |
always() &&
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.fork == false &&
env.skip_tests == 'false'
uses: MishaKav/pytest-coverage-comment@26f986d2599c288bb62f623d29c2da98609e9cd4 # v1.6.0
with:
pytest-xml-coverage-path: coverage.xml
junitxml-path: pytest.xml
report-only-changed-files: true

- name: Skip coverage report if no tests
if: env.skip_tests == 'true'
run: |
Expand Down
Loading