forked from NG-ZORRO/ng-zorro-antd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
96 lines (84 loc) · 2.71 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
# Node.js with Angular
# Build a Node.js project that uses Angular.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
stages:
- stage: env
jobs:
- job: Nodes
steps:
- task: NodeTool@0
inputs:
versionSpec: '14.16.1'
displayName: 'Install Node.js'
- stage: build
jobs:
- job: build_site
steps:
- task: Npm@1
inputs:
command: 'install'
- script: |
npm run build
export DEPLOY_DOMAIN=https://preview-${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}-ng-zorro-antd.surge.sh
echo 'version' >> dist/browser/.surgeignore
echo 'issue-helper' >> dist/browser/.surgeignore
npx surge --project ./dist/browser --domain $DEPLOY_DOMAIN
tar --transform='flags=r;s|browser|dist|' -cvzf build.tgz lib -C dist browser
- task: CopyFiles@2
inputs:
contents: build.tgz
targetFolder: $(Build.ArtifactStagingDirectory)
displayName: 'Copy archives to artifacts staging directory'
- task: PublishBuildArtifacts@1
inputs:
path: $(Build.ArtifactStagingDirectory)
displayName: 'Upload artifacts'
dependsOn: env
- stage: test
jobs:
- job: test_components
steps:
- task: Npm@1
inputs:
command: 'install'
- script: |
npm run test
cat ./coverage-report/lcov.info | ./node_modules/.bin/codecov
- task: PublishCodeCoverageResults@1
displayName: 'publish code coverage results'
condition: succeededOrFailed()
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: $(System.DefaultWorkingDirectory)/coverage-report/cobertura-coverage.xml
reportDirectory: $(System.DefaultWorkingDirectory)/coverage-report
failIfCoverageEmpty: true
- task: PublishTestResults@2
displayName: 'publish test results'
condition: succeededOrFailed()
inputs:
searchFolder: $(System.DefaultWorkingDirectory)/junit
failTaskOnFailedTests: true
testRunTitle: NG-ZORRO
testResultsFormat: JUnit
testResultsFiles: "**/TESTS*.xml"
- job: test_schematics
steps:
- task: Npm@1
inputs:
command: 'install'
- script: npm run test:schematics
dependsOn: env
- stage: lint
jobs:
- job: lint_components
steps:
- task: Npm@1
inputs:
command: 'install'
- script: npm run lint
dependsOn: env