Merge pull request #34 from karthiknadig/sonarcloud

Enable sonar cloud analysis
This commit is contained in:
Karthik Nadig 2020-02-04 12:33:16 -08:00 committed by GitHub
commit b3ba09467a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,18 +2,36 @@ steps:
- template: "use_python.yml"
- script: |
python -m pip install -U pip setuptools tox
python -m pip install -U pip setuptools tox
displayName: 'Setup Python packages'
- task: SonarCloudPrepare@1
displayName: 'Prepare analysis on SonarCloud'
inputs:
SonarCloud: 'SonarCloud-debugpy'
organization: microsoft
scannerMode: CLI
extraProperties: |
sonar.python.coverage.reportPaths=$(Build.SourcesDirectory)/coverage/coverage.xml
sonar.projectKey=microsoft_debugpy
- script: |
python -m tox --develop -e py38-cov -- --cov-report=html --cov-report=xml -vv
python -m tox --develop -e py38-cov -- --cov-report=html --cov-report=xml -vv
displayName: 'Coverage Run'
- task: SonarCloudAnalyze@1
displayName: 'Run Code Analysis'
- task: SonarCloudPublish@1
displayName: 'Publish Quality Gate Result'
inputs:
pollingTimeoutSec: '300'
- task: PublishCodeCoverageResults@1
displayName: 'Publish Coverage Report'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(Build.SourcesDirectory)/**/coverage/coverage.xml'
reportDirectory: '$(Build.SourcesDirectory)/**/coverage/html'
summaryFileLocation: '$(Build.SourcesDirectory)/coverage/coverage.xml'
reportDirectory: '$(Build.SourcesDirectory)/coverage/html'
failIfCoverageEmpty: true
condition: always()