Skip to content

Commit 0504056

Browse files
committed
Enhance GitHub Actions workflow for testing and coverage reporting
- Add pytest-cov for coverage measurement during tests. - Update pytest command to include coverage reporting in Cobertura format. - Set up environment variable for Codacy project token. - Add step to upload coverage reports to Codacy for better visibility.
1 parent 252ddf7 commit 0504056

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,18 @@ jobs:
2424
- name: 📚 Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip
27-
pip install pytest pytest-mock
27+
pip install pytest pytest-mock pytest-cov
2828
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
2929
3030
- name: 🧪 Run pytest
3131
run: |
32-
pytest
32+
pytest --cov=. --cov-report=cobertura
33+
34+
- name: Set up Codacy Project Token
35+
run: echo "CODACY_PROJECT_TOKEN=${{ secrets.CODACY_PROJECT_TOKEN }}" >> $GITHUB_ENV
36+
37+
- name: Upload coverage reports to Codacy
38+
run: bash <(curl -Ls https://coverage.codacy.com/get.sh)
3339

3440
prepare-release:
3541
name: 🏷️ Prepare Release

0 commit comments

Comments
 (0)