From 02c713f0dcd609c175e4808a02a541e89ba3708d Mon Sep 17 00:00:00 2001 From: benyissa Date: Tue, 16 Jul 2024 17:14:59 +0100 Subject: [PATCH] Add code coverage to workflow --- .github/workflows/pytest.yml | 8 +++++++- tests/test-requirement.txt | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 708d2c8..8a4e9ca 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -36,4 +36,10 @@ jobs: python -m pip install -r tests/test-requirement.txt - name: Running tests with pytest. run: | - pytest + pytest --cov=./ --cov-report=xml:coverage.xml --cov-report=term-missing + - name: Upload coverage to Codecov. + uses: codecov/codecov-action@v4 + with: + verbose: true + token: ${{ secrets.CODECOV_TOKEN }} + file: coverage.xml diff --git a/tests/test-requirement.txt b/tests/test-requirement.txt index 78c4fb9..146930a 100644 --- a/tests/test-requirement.txt +++ b/tests/test-requirement.txt @@ -1,5 +1,6 @@ ruff pytest +pytest-cov pytest-mock mypy typing-extensions