added python versions and coverage action #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python Tests | |
on: | |
push: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.8, 3.9, 3.10] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
pip install poetry | |
poetry install | |
- name: Run pytest with coverage and generate report | |
run: poetry run pytest --cov=app --cov-report=term-missing:skip-covered tests/ | tee pytest-coverage.txt | |
- name: Upload pytest coverage report as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pytest-coverage-report | |
path: pytest-coverage.txt | |
- name: Pytest coverage comment | |
uses: MishaKav/pytest-coverage-comment@main | |
with: | |
pytest-coverage-path: ./pytest-coverage.txt |