-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathazure-pipelines.yml
72 lines (70 loc) · 2.18 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
trigger:
branches:
include:
- refs/heads/*
- refs/tags/*
resources:
containers:
- container: node12
image: node:12.10-stretch-slim
- container: node10
image: node:10.16-stretch-slim
- container: node8
image: node:8.16-stretch-slim
stages:
- stage: Tests
jobs:
- job: TestsJobNode12
container: node12
steps:
- bash: |
npm install && npm test
- task: PublishTestResults@2
displayName: "Publish Test Results"
condition: succeededOrFailed()
inputs:
testResultsFiles: "junit.xml"
testRunTitle: TestRun Node 12
- task: PublishCodeCoverageResults@1
displayName: "Publish Coverage Results"
condition: succeededOrFailed()
inputs:
codeCoverageTool: "cobertura"
summaryFileLocation: "coverage/cobertura-coverage.xml"
reportDirectory: "coverage/lcov-report"
- job: TestsJobNode10
container: node10
steps:
- bash: |
npm install && npm test
- task: PublishTestResults@2
displayName: "Publish Test Results"
condition: succeededOrFailed()
inputs:
testResultsFiles: "junit.xml"
testRunTitle: TestRun Node 10
- job: TestsJobNode8
container: node8
steps:
- bash: |
npm install && npm test
- task: PublishTestResults@2
displayName: "Publish Test Results"
condition: succeededOrFailed()
inputs:
testResultsFiles: "junit.xml"
testRunTitle: TestRun Node 8
- stage: BuildAndPublish
jobs:
- job: PublishJob
container: node12
steps:
- bash: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc && \
npm install && \
npm run build && \
npm run build:publish -- $(Build.SourceBranch) && \
rm -rf ~/.npmrc
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
env:
NPM_TOKEN: $(secretNpmToken)