This repository has been archived by the owner on Apr 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
azure-pipelines.yml
96 lines (80 loc) · 2.81 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
trigger:
- master
pr:
- master
strategy:
matrix:
node_12_x:
node_version: 12.x
node_13_x:
node_version: 13.x
maxParallel: 2
pool:
vmImage: "ubuntu-latest"
variables:
- group: 'spk-vg'
steps:
- task: NodeTool@0
inputs:
versionSpec: "$(node_version)"
displayName: "Install Node.js"
- script: |
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
displayName: "Install az-cli"
- script: |
yarn
displayName: "YARN INSTALL"
- script: |
yarn lint
displayName: "YARN LINT"
- script: |
yarn md-lint
displayName: "YARN MARKDOWN LINT"
- script: |
yarn build
displayName: "YARN BUILD"
- script: |
yarn test
displayName: "YARN TEST"
timeoutInMinutes: 3
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: "$(System.DefaultWorkingDirectory)/**/*coverage.xml"
reportDirectory: "$(System.DefaultWorkingDirectory)/**/coverage"
condition: and(eq(variables['Agent.JobStatus'], 'Succeeded'), endsWith(variables['Agent.JobName'], 'node_12_x'))
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/junit.xml'
condition: and(eq(variables['Agent.JobStatus'], 'Succeeded'), endsWith(variables['Agent.JobName'], 'node_12_x'))
- task: PublishPipelineArtifact@1
inputs:
path: $(System.DefaultWorkingDirectory)/dist/spk-linux
artifact: spk_linux_node_12
condition: and(eq(variables['Agent.JobStatus'], 'Succeeded'), endsWith(variables['Agent.JobName'], 'node_12_x'))
- bash: |
[ -z "$COVERAGE_VARIANCE" ] && { echo "Missing COVERAGE_VARIANCE variable"; exit 1; }
echo "Code coverage variance value is: $COVERAGE_VARIANCE"
displayName: 'Build quality pre-validation'
failOnStderr: true
env:
COVERAGE_VARIANCE: $(COVERAGE_VARIANCE)
condition: and(eq(variables['Agent.JobStatus'], 'Succeeded'), endsWith(variables['Agent.JobName'], 'node_12_x'))
- task: mspremier.BuildQualityChecks.QualityChecks-task.BuildQualityChecks@6
displayName: 'Check build quality'
inputs:
checkWarnings: false
warningFailOption: fixed
warningFilters: ''
showStatistics: true
checkCoverage: true
coverageFailOption: build # We are comparing against the previous build in baseBranchRef
coverageType: branches # We are looking at code branch coverage, not line coverage
coverageDeltaType: percentage
allowCoverageVariance: true
coverageVariance: $(COVERAGE_VARIANCE) # Prefer a value less 1.00
baseDefinitionId: $(SPK_DEFINITION_ID)
baseBranchRef: refs/heads/master
runTitle: 'Code Coverage Evaluation'
condition: and(eq(variables['Agent.JobStatus'], 'Succeeded'), endsWith(variables['Agent.JobName'], 'node_12_x'))