-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathazure-pipelines.yml
57 lines (47 loc) · 1.58 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
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- master
pr:
branches:
include:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSpec: '12.x'
checkLatest: true
displayName: 'Install Node.js'
- task: SonarCloudPrepare@1
inputs:
SonarCloud: 'SonarCloud'
organization: 'axaguildev'
scannerMode: 'CLI'
configMode: 'manual'
cliProjectKey: 'skizzle'
cliProjectName: 'skizzle'
cliProjectVersion: '1.2.0'
cliSources: 'src'
extraProperties: |
# Additional properties that will be passed to the scanner,
# Put one key=value per line, example:
sonar.tests=src
sonar.test.inclusions=src/**/*.test.js
sonar.javascript.lcov.reportPaths=coverage/lcov.info
- script: npm install && npm run build
displayName: 'npm install and build'
- script: npm test -- --coverage
displayName: 'npm run test:coverage'
- task: SonarCloudAnalyze@1
displayName: 'Run Code Analysis'
condition: and(succeeded(), eq(variables['System.PullRequest.IsFork'], 'False'))
- task: SonarCloudPublish@1
displayName: 'Publish Quality Gate Result'
condition: and(succeeded(), eq(variables['System.PullRequest.IsFork'], 'False'))
- script: node ./scripts/publish-changelog.js $(Github.Token)
displayName: 'Generate Changelog'
condition: and(succeeded(), ne(variables['App.Version'], 'none'), eq(variables['System.PullRequest.IsFork'], 'False'))