-
Notifications
You must be signed in to change notification settings - Fork 25
/
azure-pipelines.yml
65 lines (54 loc) · 1.63 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
59
60
61
62
63
64
65
trigger:
branches:
include:
- main
- master
- ia-site
- refs/tags/v*
- refs/heads/review/*
- refs/heads/dev/*
- refs/heads/user/*
paths:
exclude:
- CHANGELOG.md
- README.md
pool:
vmImage: 'ubuntu-latest'
steps:
- script: npm ci
displayName: 'Install'
- task: SonarCloudPrepare@1
displayName: 'Prepare analysis on SonarCloud'
inputs:
SonarCloud: 'SonarCloud'
organization: 'nhsdigital'
scannerMode: 'CLI'
extraProperties: |
sonar.projectKey=nhsuk-service-manual
sonar.exclusions=$(System.DefaultWorkingDirectory)/dependency-scan-results/**
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.coverage.exclusions=**/*.config.js,**/coverage/**
sonar.dependencyCheck.htmlReportPath=$(System.DefaultWorkingDirectory)/dependency-scan-results/dependency-check-report.html
sonar.language=js
- script: npm run build
displayName: 'Build'
- script: npm run test
displayName: 'Test'
- task: SonarCloudAnalyze@1
displayName: 'Run SonarCloud Code Analysis'
- task: SonarCloudPublish@1
displayName: 'Publish Quality Gate Result'
inputs:
pollingTimeoutSec: '300'
- task: sonarcloud-buildbreaker@2
displayName: "Break the build if the quality gate fails"
inputs:
SonarCloud: 'SonarCloud'
organization: 'nhsdigital'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(System.DefaultWorkingDirectory)'
includeRootFolder: false
displayName: 'Create file archive to publish'
- task: PublishBuildArtifacts@1
displayName: 'Publish files to Azure Pipelines'