Skip to content

Commit 17a7798

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

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

.github/workflows/unit-test.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,24 @@ 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
2727
pip install -r requirements.txt
2828
29-
- name: Run Unit Tests
29+
- name: Install dependencies
3030
run: |
31-
python -m unittest discover -s tests
31+
python -m pip install --upgrade pip
32+
pip install pytest pytest-cov
33+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
34+
35+
- name: Test with pytest
36+
run: |
37+
pytest --cov-branch --cov-report=xml tests/
38+
39+
- name: Upload coverage reports to Codecov
40+
uses: codecov/codecov-action@v5
41+
with:
42+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)