Add coverage to CI workflow

This commit is contained in:
thePR0M3TH3AN
2025-06-29 15:20:05 -04:00
parent 02a0d4bf98
commit 786f2c2bc5
2 changed files with 18 additions and 3 deletions

View File

@@ -14,9 +14,23 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('src/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Set up Python dependencies
id: deps
run: |
python -m pip install --upgrade pip
pip install -r src/requirements.txt
- name: Test with pytest
run: pytest -q src/tests
- name: Run tests with coverage
run: |
pytest --cov=src --cov-report=xml --cov-report=term-missing src/tests
- name: Upload coverage report
uses: actions/upload-artifact@v3
with:
name: coverage-xml
path: coverage.xml