Skip to content

Commit b3ba094

Browse files
authored
Merge pull request #34 from karthiknadig/sonarcloud
Enable sonar cloud analysis
2 parents 3024095 + 892483c commit b3ba094

1 file changed

Lines changed: 22 additions & 4 deletions

File tree

azure-pipelines/templates/coverage.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,36 @@ steps:
22
- template: "use_python.yml"
33

44
- script: |
5-
python -m pip install -U pip setuptools tox
5+
python -m pip install -U pip setuptools tox
66
displayName: 'Setup Python packages'
77
8+
- task: SonarCloudPrepare@1
9+
displayName: 'Prepare analysis on SonarCloud'
10+
inputs:
11+
SonarCloud: 'SonarCloud-debugpy'
12+
organization: microsoft
13+
scannerMode: CLI
14+
extraProperties: |
15+
sonar.python.coverage.reportPaths=$(Build.SourcesDirectory)/coverage/coverage.xml
16+
sonar.projectKey=microsoft_debugpy
17+
818
- script: |
9-
python -m tox --develop -e py38-cov -- --cov-report=html --cov-report=xml -vv
19+
python -m tox --develop -e py38-cov -- --cov-report=html --cov-report=xml -vv
1020
displayName: 'Coverage Run'
1121
22+
- task: SonarCloudAnalyze@1
23+
displayName: 'Run Code Analysis'
24+
25+
- task: SonarCloudPublish@1
26+
displayName: 'Publish Quality Gate Result'
27+
inputs:
28+
pollingTimeoutSec: '300'
29+
1230
- task: PublishCodeCoverageResults@1
1331
displayName: 'Publish Coverage Report'
1432
inputs:
1533
codeCoverageTool: Cobertura
16-
summaryFileLocation: '$(Build.SourcesDirectory)/**/coverage/coverage.xml'
17-
reportDirectory: '$(Build.SourcesDirectory)/**/coverage/html'
34+
summaryFileLocation: '$(Build.SourcesDirectory)/coverage/coverage.xml'
35+
reportDirectory: '$(Build.SourcesDirectory)/coverage/html'
1836
failIfCoverageEmpty: true
1937
condition: always()

0 commit comments

Comments
 (0)