-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
89 lines (77 loc) · 2.4 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
trigger:
branches:
include:
- master
- develop
pr: none
jobs:
- job: buildAndUnitTest
displayName: Build and run unit tests on
strategy:
matrix:
Linux:
imageName: "ubuntu-latest"
isPrimaryStrategy: true
MacOs:
imageName: "macOs-latest"
Windows:
imageName: "windows-latest"
pool:
vmImage: "$(imageName)"
variables:
isMaster: $[eq(variables['Build.SourceBranch'], 'refs/heads/master')]
steps:
- task: UseNode@1
displayName: "Install Node.js"
inputs:
version: "14.3.0"
continueOnError: false
- task: CmdLine@2
displayName: "Install Dependencies"
inputs:
script: |
npm ci
continueOnError: false
- task: CmdLine@2
displayName: "Build Project"
inputs:
script: |
npm run build
continueOnError: false
- task: CmdLine@2
displayName: "Test Project"
inputs:
script: |
npm run coverage --ci
continueOnError: false
- task: PublishCodeCoverageResults@1
displayName: "Publish Coverage Results"
condition: and(succeeded(), variables.isPrimaryStrategy, variables.isMaster)
inputs:
codeCoverageTool: "Cobertura"
summaryFileLocation: "$(System.DefaultWorkingDirectory)/**/coverage/cobertura-coverage.xml"
reportDirectory: "$(System.DefaultWorkingDirectory)/**/coverage"
continueOnError: false
- task: Bash@3
displayName: "Upload to CodeCov"
condition: and(succeeded(), variables.isPrimaryStrategy, variables.isMaster)
inputs:
targetType: "inline"
script: "bash <(curl -s https://codecov.io/bash)"
env:
CODECOV_TOKEN: $(CODECOV_TOKEN)
- task: CmdLine@2
displayName: "Generate Docs"
condition: and(succeeded(), variables.isPrimaryStrategy, variables.isMaster)
inputs:
script: |
npm run docs
continueOnError: false
- task: PublishPipelineArtifact@1
displayName: "Publish Docs"
condition: and(succeeded(), variables.isPrimaryStrategy, variables.isMaster)
inputs:
targetPath: "$(System.DefaultWorkingDirectory)/docs"
artifact: "Types Docs"
publishLocation: "pipeline"
continueOnError: false