Spaces:
Sleeping
Sleeping
# This workflow will install dependencies, create coverage tests and run Pytest Coverage Commentator | |
# For more information see: https://github.com/coroo/pytest-coverage-commentator | |
name: pytest-coverage-in-PR | |
on: | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
if [ -f tests/requirements.txt ]; then pip install -r tests/requirements.txt; fi | |
- name: Build coverage files for mishakav commenter action | |
# note this will run all non-visual tests, including the slow end2end ones | |
# - this action is only on PR; the slow ones are skipped on push. | |
run: | | |
pytest -s -m "not visual" --ignore=tests/visual_selenium --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=src tests/ | tee pytest-coverage.txt | |
echo "working dir:" && pwd | |
echo "files in cwd:" && ls -ltr | |
- name: Pytest coverage comment | |
uses: MishaKav/pytest-coverage-comment@main | |
with: | |
pytest-coverage-path: ./pytest-coverage.txt | |
junitxml-path: ./pytest.xml | |
#- name: Comment coverage | |
# uses: coroo/[email protected] | |