Skip to content

Commit b341061

Browse files
committed
ci: setup unit tests with coverage
1 parent 958bb24 commit b341061

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.github/workflows/unit-test.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,19 @@ jobs:
1919
- name: Set up Python
2020
uses: actions/setup-python@v5
2121
with:
22-
python-version: '3.10'
22+
python-version: '3.12'
2323

2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip
27-
pip install -r requirements.txt
27+
pip install pytest pytest-cov
28+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
2829
29-
- name: Run Unit Tests
30+
- name: Test with pytest
3031
run: |
31-
python -m unittest discover -s tests
32+
pytest --cov-branch --cov-report=xml tests/
33+
34+
- name: Upload coverage reports to Codecov
35+
uses: codecov/codecov-action@v5
36+
with:
37+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)