Skip to content

Commit a1c12b6

Browse files
committed
Refactor build workflow and add SonarCloud analysis
1 parent 987c58c commit a1c12b6

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
steps:
1616
- name: Checkout code
1717
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
1820

1921
- name: Set up Python
2022
uses: actions/setup-python@v5
@@ -28,17 +30,9 @@ jobs:
2830
python3.12 -m pip install --upgrade pip
2931
pip install -r test_requirements.txt
3032
coverage run -m pytest
33+
coverage xml -o coverage.xml --relative-files
3134
deactivate
3235
rm -rf env
33-
34-
sonarcloud:
35-
name: SonarCloud
36-
runs-on: ubuntu-latest
37-
needs: python-test
38-
steps:
39-
- uses: actions/checkout@v4
40-
with:
41-
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
4236
- name: SonarCloud Scan
4337
uses: SonarSource/sonarcloud-github-action@master
4438
env:

sonar-project.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ sonar.organization=chrisw-org
1111

1212
# Encoding of the source code. Default is default system encoding
1313
#sonar.sourceEncoding=UTF-8
14-
sonar.python.version=3.12
14+
sonar.python.version=3.12
15+
sonar.python.coverage.reportPaths=coverage.xml

0 commit comments

Comments
 (0)