Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit 523ada2

Browse files
committed
Update sonarcloud CI
1 parent 574b920 commit 523ada2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.github/workflows/sonarcloud.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ jobs:
3434
pip install -e .
3535
- name: Collect coverage
3636
run: |
37-
pytest --cov=src --quiet
38-
coverage xml
37+
pytest --cov=src --cov-report=xml --cov-config=pyproject.toml --cov-branch
3938
- name: Upload coverage report
4039
uses: actions/upload-artifact@v2
4140
with:
@@ -48,6 +47,7 @@ jobs:
4847
-Dsonar.projectKey=edu-python-course_problem-sets
4948
-Dsonar.organization=edu-python-course
5049
-Dsonar.python.coverage.reportPaths=coverage.xml -X
50+
-Dsonar.coverage.exclusions=**/scripts/**,**/__init__,**/__main__,**/tests/** -X
5151
env:
5252
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
5353
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ addopts = "--cov=src --verbose"
6767
testpaths = ["tests"]
6868

6969
[tool.coverage.run]
70+
relative_files = true
71+
branch = true
7072
source = ["src"]
7173
omit = [
7274
"*__init__*",

0 commit comments

Comments
 (0)