diff --git a/.github/.codecov.yml b/.github/.codecov.yml new file mode 100644 index 0000000..24c7328 --- /dev/null +++ b/.github/.codecov.yml @@ -0,0 +1,6 @@ +# Copyright (C) 2024 Roberto Rossini +# +# SPDX-License-Identifier: MIT + +ignore: + - "test/" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d744b6d..c40e786 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,7 +89,17 @@ jobs: run: pip install --verbose '.[test]' - name: Run unit tests - run: python -m pytest test -v + run: python -m pytest --cov -v --cov-report=xml . + + - name: Upload unit test coverage report to Codecov + uses: codecov/codecov-action@v4 + with: + flags: "tests | unit | python-${{ matrix.python_version }}" + disable_search: true + files: coverage.xml + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true - name: Run simple CLI tests run: | diff --git a/pyproject.toml b/pyproject.toml index d54aa63..7aac74a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,6 +60,7 @@ dependencies = [ test = [ "pytest", + "pytest-cov", "stripepy", ]