Skip to content

Commit

Permalink
migrate to sonarcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
sikanderakbarali committed Feb 20, 2024
1 parent 076d260 commit 1014018
Showing 1 changed file with 26 additions and 16 deletions.
42 changes: 26 additions & 16 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ stages:
jobs:
- job: Test
steps:
- checkout: self
fetchDepth: 0
- task: NodeTool@0
displayName: 'Install Node.js'
inputs:
Expand All @@ -26,28 +28,36 @@ stages:
- script: npm ci
displayName: 'Install'

- task: SonarQubePrepare@5
displayName: 'Prepare analysis on SonarQube'
inputs:
SonarQube: 'sonarqube-connection'
scannerMode: 'CLI'
configMode: 'manual'
cliProjectName: 'User Feedback Store'
cliProjectKey: 'UserFeedbackStore'
extraProperties: |
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.coverage.exclusions=**/*.config.js,**/coverage/**
- task: SonarCloudPrepare@1
displayName: "Prepare static analysis"
inputs:
SonarCloud: "SonarCloud"
organization: "nhsdigital"
scannerMode: "MSBuild"
projectKey: "UserFeedbackStore"
extraProperties: |
sonar.language=cs
sonar.dotnet.excludeGeneratedCode=true
sonar.cs.vstest.reportsPaths=**/TEST-*.trx
sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/coverage.opencover.xml
sonar.sourceEncoding=UTF-8
sonar.scm.provider=git
sonar.dependencyCheck.htmlReportPath=dependency-scan-results/dependency-check-report.html
- script: npm run test
displayName: 'Test'

- task: SonarQubeAnalyze@5
displayName: 'Run code analysis'
- task: SonarCloudAnalyze@1
displayName: 'Run SonarCloud Code Analysis'

- task: SonarCloudPublish@1
displayName: 'Publish Quality Gate Result'

- task: SonarQubePublish@5
displayName: 'Publish quality gate result'
- task: sonarcloud-buildbreaker@2
displayName: "Break the build if the quality gate fails"
inputs:
pollingTimeoutSec: '300'
SonarCloud: 'SonarCloud'
organization: 'nhsdigital'

- stage: DevDeployment
displayName: 'Dev Deployment'
Expand Down

0 comments on commit 1014018

Please sign in to comment.