DocsGPT/.github/workflows/pytest.yml

40 lines
1.2 KiB
YAML
Raw Normal View History

name: Run python tests with pytest
on: [push, pull_request]
jobs:
2023-08-15 16:29:12 +00:00
pytest_and_coverage:
name: Run tests and count coverage
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
2023-08-15 16:29:12 +00:00
pip install pytest pytest-cov
cd application
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
2023-08-15 16:29:12 +00:00
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