forked from hyperledger-caliper/caliper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
157 lines (147 loc) · 4.34 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
trigger:
branches:
include:
- main
pr:
branches:
include:
- main
pool:
vmImage: "ubuntu-latest"
variables:
- group: credentials
- name: NODEVER
value: 14.x
stages:
- stage: UnitTests
displayName: Run unit tests
jobs:
- job: unitTests
displayName: "Base build and unit tests"
strategy:
matrix:
Node14:
NODEVER: 14.x
Node16:
NODEVER: 16.x
steps:
- task: NodeTool@0
inputs:
versionSpec: "$(NODEVER)"
displayName: "Install Node.js"
- script: |
./scripts/check-package-names.sh
displayName: "Check correct usage of Caliper package names"
- script: |
npm install
npm run bootstrap
displayName: "Install project dependencies"
- script: |
./packages/caliper-publish/publish.js version check
displayName: "Check the version consistency of subpackages"
- script: |
npm test
displayName: "Run unit tests"
- stage: IntegrationTests
displayName: Run integration tests
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
dependsOn: UnitTests
jobs:
- job: fabricIntegration
displayName: "Fabric Integration Test"
strategy:
matrix:
Node14:
NODEVER: 14.x
Node16:
NODEVER: 16.x
variables: { BENCHMARK: fabric }
steps:
- task: NodeTool@0
inputs:
versionSpec: "$(NODEVER)"
displayName: "Install Node.js"
- script: |
.build/benchmark-integration-test-direct.sh
- job: ethereumIntegration
displayName: "Ethereum Integration Test"
strategy:
matrix:
Node14:
NODEVER: 14.x
Node16:
NODEVER: 16.x
variables: { BENCHMARK: ethereum }
steps:
- task: NodeTool@0
inputs:
versionSpec: "$(NODEVER)"
displayName: "Install Node.js"
- script: |
.build/benchmark-integration-test-direct.sh
- job: besuIntegration
displayName: "Besu Integration Test"
strategy:
matrix:
Node14:
NODEVER: 14.x
Node16:
NODEVER: 16.x
variables: { BENCHMARK: besu }
steps:
- task: NodeTool@0
inputs:
versionSpec: "$(NODEVER)"
displayName: "Install Node.js"
- script: |
.build/benchmark-integration-test-direct.sh
- job: fiscoIntegration
displayName: "FISCO BCOS Integration Test"
strategy:
matrix:
Node14:
NODEVER: 14.x
Node16:
NODEVER: 16.x
variables: { BENCHMARK: fisco-bcos }
steps:
- task: NodeTool@0
inputs:
versionSpec: "$(NODEVER)"
displayName: "Install Node.js"
- script: |
.build/benchmark-integration-test-direct.sh
- job: generatorIntegration
displayName: "Generator Integration Test"
strategy:
matrix:
Node14:
NODEVER: 14.x
Node16:
NODEVER: 16.x
variables: { BENCHMARK: generator }
steps:
- task: NodeTool@0
inputs:
versionSpec: "$(NODEVER)"
displayName: "Install Node.js"
- script: |
.build/benchmark-integration-test-direct.sh
- stage: Publish
displayName: Publish Caliper
# having a blind succeeded here will not work if a preceding stage was skipped
condition: and(not(failed('UnitTests')), eq(variables['Build.Reason'], 'IndividualCI'))
jobs:
- job: PublishCaliper
displayName: "Publish Caliper to NPM and DockerHub"
steps:
- task: NodeTool@0
inputs:
versionSpec: "$(NODEVER)"
displayName: "Install Node.js"
- script: .build/publish-caliper.sh
displayName: Publish Caliper
env:
NPM_TOKEN: "$(npm)"
DOCKER_USER: "$(DockerHub-Username)"
DOCKER_TOKEN: "$(DockerHub-Password)"