-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
58 lines (48 loc) · 1.25 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
pool:
vmImage: 'ubuntu-latest'
steps:
- task: SonarCloudPrepare@1
inputs:
SonarCloud: 'SonarCloud'
organization: 'nhsdigital'
scannerMode: 'CLI'
configMode: 'file'
extraProperties: |
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.language=js
sonar.projectKey=nhsuk-prototype-kit
sonar.sourceEncoding=UTF-8
- task: Npm@1
displayName: 'npm install'
inputs:
verbose: true
- task: Npm@1
displayName: 'npm run build'
inputs:
command: 'custom'
customCommand: run build
verbose: true
- task: Npm@1
displayName: 'npm run test'
inputs:
command: 'custom'
customCommand: run test
verbose: true
- task: SonarCloudAnalyze@1
inputs:
jdkversion: 'JAVA_HOME_17_X64'
displayName: 'Run SonarCloud Code Analysis'
- task: SonarCloudPublish@1
displayName: 'Publish Quality Gate Result'
- task: sonarcloud-buildbreaker@2
displayName: "Break the build if the quality gate fails"
inputs:
SonarCloud: 'SonarCloud'
organization: 'nhsdigital'
- task: ArchiveFiles@2
displayName: 'Archive files'
inputs:
rootFolderOrFile: '$(System.DefaultWorkingDirectory)'
includeRootFolder: false
- task: PublishBuildArtifacts@1
displayName: 'Publish artifacts: drop'