-
Notifications
You must be signed in to change notification settings - Fork 2.8k
/
azure-pipelines.perf-test.yml
199 lines (173 loc) · 6.89 KB
/
azure-pipelines.perf-test.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
pr:
- master
- website-content
trigger: none
variables:
- group: fabric-variables
- template: .devops/templates/variables.yml
pool: '1ES-Host-Ubuntu'
jobs:
- job: CheckIfPackagesAffected
steps:
- template: .devops/templates/tools.yml
- task: Bash@3
inputs:
filePath: yarn-ci.sh
displayName: yarn
- script: |
NorthstarAffected=$(yarn --silent check:affected --project react-northstar)
V8Affected=$(yarn --silent check:affected --project react)
ReactComponentsAffected=$(yarn --silent check:affected --project react-components)
if [[ $NorthstarAffected == true ]]; then
echo "##vso[task.setvariable variable=NorthstarPackageAffected;isOutput=true]true"
fi
if [[ $V8Affected == true ]]; then
echo "##vso[task.setvariable variable=V8PackageAffected;isOutput=true]true"
fi
if [[ $ReactComponentsAffected == true ]]; then
echo "##vso[task.setvariable variable=ReactComponentsPackageAffected;isOutput=true]true"
fi
name: PackagesAffected
displayName: Check if v8, v9 and/or northstar packages were affected
- job: PerfTestReactNorthstar
displayName: Perf test for @fluentui/react-northstar
dependsOn: CheckIfPackagesAffected
condition: eq(dependencies.CheckIfPackagesAffected.outputs['PackagesAffected.NorthstarPackageAffected'], true)
workspace:
clean: all
steps:
- template: .devops/templates/tools.yml
- task: Bash@3
inputs:
filePath: yarn-ci.sh
displayName: yarn
- script: |
yarn nx run perf-test-northstar:test-perf --base
condition: eq(variables.isPR, false)
displayName: Run Perf Test Base (Northstar)
- script: |
yarn nx run perf-test-northstar:test-perf
condition: eq(variables.isPR, true)
displayName: Run Perf Test (Northstar)
- task: AzureCLI@2
condition: eq(variables.isPR, true)
displayName: Upload Perf Test Result to PR deploy site (Fluent N*)
inputs:
azureSubscription: $(azureSubscription)
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az storage blob upload-batch \
--destination '$web' \
--source packages/fluentui/perf-test-northstar/dist \
--account-name $(azureStorage) \
--destination-path $(deployBasePath)/perf-test-northstar \
--auth-mode login \
--overwrite
- task: GithubPRComment@0
condition: eq(variables.isPR, true)
displayName: 'Post @fluentui/react-northstar Perf Results to Github Pull Request'
inputs:
githubOwner: microsoft
githubRepo: 'fluentui'
blobFilePath: '$(Build.SourcesDirectory)/$(PerfCommentFilePathReactNorthstar)'
status: '$(PerfCommentStatusReactNorthstar)'
uniqueId: 'perfComment9424'
- script: |
yarn gulp stats
condition: eq(variables.isPR, false)
displayName: Bundle Statistics (master only)
- script: |
yarn nx run perf:test-perf
condition: eq(variables.isPR, false)
displayName: Performance Tests (master only)
# HEADS UP: also see tag-version-prefix in fluentui-publish.js
- script: |
yarn gulp stats:save --tag=`git tag --points-at HEAD | grep ^@fluentui/react-northstar_v | grep -o 'northstar_v.*'`
condition: eq(variables.isPR, false)
displayName: Save Statistics to DB (master only)
env:
STATS_URI: $(STATS_URI)
- template: .devops/templates/cleanup.yml
- job: PerfTestReact
displayName: Perf test for @fluentui/react
dependsOn: CheckIfPackagesAffected
condition: eq(dependencies.CheckIfPackagesAffected.outputs['PackagesAffected.V8PackageAffected'], true)
workspace:
clean: all
steps:
- template: .devops/templates/tools.yml
- task: Bash@3
inputs:
filePath: yarn-ci.sh
displayName: yarn
- script: |
yarn nx run perf-test:test-perf
condition: eq(variables.isPR, true)
displayName: Run Perf Test
- task: AzureCLI@2
condition: eq(variables.isPR, true)
displayName: Upload Perf Test Result to PR deploy site (V8)
inputs:
azureSubscription: $(azureSubscription)
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az storage blob upload-batch \
--destination '$web' \
--source apps/perf-test/dist \
--account-name $(azureStorage) \
--destination-path $(deployBasePath)/perf-test \
--auth-mode login \
--overwrite
- task: GithubPRComment@0
condition: eq(variables.isPR, true)
displayName: 'Post @fluentui/react Perf Results to Github Pull Request'
inputs:
githubOwner: microsoft
githubRepo: 'fluentui'
blobFilePath: '$(Build.SourcesDirectory)/$(PerfCommentFilePathReact)'
status: '$(PerfCommentStatusReact)'
uniqueId: 'perfComment9423'
- template: .devops/templates/cleanup.yml
- job: PerfTestReactComponents
displayName: Perf test for @fluentui/react-components
dependsOn: CheckIfPackagesAffected
condition: eq(dependencies.CheckIfPackagesAffected.outputs['PackagesAffected.ReactComponentsPackageAffected'], true)
workspace:
clean: all
steps:
- template: .devops/templates/tools.yml
- task: Bash@3
inputs:
filePath: yarn-ci.sh
displayName: yarn
- script: |
yarn nx run perf-test-react-components:test-perf
condition: eq(variables.isPR, true)
displayName: Run Perf Test
- task: AzureCLI@2
condition: eq(variables.isPR, true)
displayName: Upload Perf Test Result to PR deploy site (React Components)
inputs:
azureSubscription: $(azureSubscription)
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az storage blob upload-batch \
--destination '$web' \
--source apps/perf-test-react-components/dist \
--account-name $(azureStorage) \
--destination-path $(deployBasePath)/perf-test-react-components \
--auth-mode login \
--overwrite
- task: GithubPRComment@0
condition: eq(variables.isPR, true)
displayName: 'Post @fluentui/react-components Perf Results to Github Pull Request'
inputs:
githubOwner: microsoft
githubRepo: 'fluentui'
blobFilePath: '$(Build.SourcesDirectory)/$(PerfCommentFilePathReactComponents)'
status: '$(PerfCommentStatusReactComponents)'
uniqueId: 'perfComment9425'
- template: .devops/templates/cleanup.yml