diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index b7b3d30..68e7e1b 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -26,8 +26,12 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - - # Run tests using pytest + pip install pytest-cov + + # Run tests using pytest with coverage - name: Run tests run: | - pytest -v + pytest -v --cov=./ --cov-report=xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 diff --git a/README.md b/README.md index d00bc48..03d77d3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ [![Build](https://github.com/laisee/client-python-fix/actions/workflows/python-package.yml/badge.svg)](https://github.com/laisee/client-python-fix/actions/workflows/python-package.yml) [![Ruff](https://github.com/laisee/client-python-fix/actions/workflows/rufflint.yml/badge.svg)](https://github.com/laisee/client-python-fix/actions/workflows/rufflint.yml) [![Security Check](https://github.com/laisee/client-python-fix/actions/workflows/security-check.yml/badge.svg)](https://github.com/laisee/client-python-fix/actions/workflows/security-check.yml) +[![Coverage](https://codecov.io/gh/laisee/client-python-fix/branch/main/graph/badge.svg)](https://codecov.io/gh/laisee/client-python-fix) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) diff --git a/requirements.txt b/requirements.txt index 69da855..8f87917 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,4 @@ simplefix==1.0.17 websockets==11.0.3 pytest==8.2.2 PyJWT==2.9.0 +pytest-cov==4.1.0