From 4592a1131ef0dfd2d0327be6979ae2306cb4e8d0 Mon Sep 17 00:00:00 2001 From: Johannes Thiem Date: Tue, 7 May 2024 15:27:24 +0200 Subject: [PATCH] added python versions and coverage action --- .github/workflows/python-tests.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 4081fe1..ed4684c 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -2,14 +2,13 @@ name: Python Tests on: push: - pull_request: jobs: test: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8] + python-version: [3.8, 3.9, 3.10] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} @@ -20,10 +19,14 @@ jobs: run: | pip install poetry poetry install - - name: Run pytest and generate HTML report - run: poetry run pytest --html=report.html --self-contained-html - - name: Upload HTML report + - 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-report - path: report.html + 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