Skip to content

Commit

Permalink
Merge pull request #38 from nhsuk/sonarqube-implementation
Browse files Browse the repository at this point in the history
Add SonarQube implementations to Azure pipeline
  • Loading branch information
mayank1211 authored Jun 1, 2023
2 parents 47a1f84 + b3678c0 commit 25ba887
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules/
globalConfig.json
terraform/.terraform*
dist/
coverage/
32 changes: 26 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,37 @@ stages:
- stage: Test
jobs:
- job: Test

steps:
- task: NodeTool@0
displayName: 'Install Node.js'
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'

- script: |
npm ci
npm test
displayName: 'npm test'
- 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/**
- script: npm run test
displayName: 'Test'

- task: SonarQubeAnalyze@5
displayName: 'Run code analysis'

- task: SonarQubePublish@5
displayName: 'Publish quality gate result'
inputs:
pollingTimeoutSec: '300'

- stage: DevDeployment
displayName: 'Dev Deployment'
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"start:mongo": "node ./tests/integration/mongo-dev-server.js",
"start:function": "MONGO_CONNECTION_STRING=\"mongodb://127.0.0.1:51412/userfeedback?\" func start -p 7071",
"test": "npm-run-all test:*",
"test:unit": "jest --projects tests/unit",
"test:unit": "jest --coverage --projects tests/unit",
"test:integration": "start-server-and-test 'npm start' 7071 'jest --projects tests/integration'"
},
"author": "",
Expand All @@ -30,4 +30,4 @@
"uuidv4": "^6.2.8",
"yargs": "^15.3.1"
}
}
}

0 comments on commit 25ba887

Please sign in to comment.