forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.bundlesize.yml
180 lines (146 loc) · 5.8 KB
/
azure-pipelines.bundlesize.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
pr:
- master
trigger:
- master
variables:
- ${{ if not(startsWith(variables['Build.SourceBranch'], 'refs/heads/')) }}:
- name: sinceArg
value: --since $(targetBranch)
- template: .devops/templates/variables.yml
jobs:
- job: bundlesize
workspace:
clean: all
pool: '1ES-Host-Ubuntu'
steps:
- template: .devops/templates/tools.yml
- task: Bash@3
inputs:
filePath: yarn-ci.sh
displayName: yarn
- script: |
yarn lage bundle-size --verbose $(sinceArg)
displayName: build packages & create reports
- script: |
yarn bundle-size compare-reports --branch=$(System.PullRequest.TargetBranch) --output=markdown --verbose
displayName: compare bundle size with base (PR only)
condition: eq(variables.isPR, true)
- task: GithubPRComment@0
displayName: Post results to PR (PR only)
condition: eq(variables.isPR, true)
inputs:
githubOwner: microsoft
githubRepo: 'fluentui'
blobFilePath: 'packages/bundle-size/dist/bundle-size.md'
status: 'success'
uniqueId: 'bundleSizeComment9423'
- script: |
yarn bundle-size upload-report --branch=$(Build.SourceBranchName) --commit-sha $(Build.SourceVersion)
displayName: upload a report (base only)
condition: eq(variables.isPR, false)
env:
# https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#secret-variables
BUNDLESIZE_ACCOUNT_KEY: $(bundlesize-account-key)
- template: .devops/templates/cleanup.yml
- job: build_react
workspace:
clean: all
timeoutInMinutes: 75
pool: '1ES-Host-Ubuntu'
steps:
- template: .devops/templates/tools.yml
- task: Bash@3
inputs:
filePath: yarn-ci.sh
displayName: yarn
- script: yarn build --to @fluentui/react @fluentui/keyboard-key
displayName: yarn build to @fluentui/react
- script: yarn workspace @fluentui/test-bundles bundle:size
displayName: yarn bundle @fluentui/test-bundles
env:
PACKAGE: '@fluentui/react'
- script: yarn bundlesizecollect
displayName: 'Collate Bundle Size Information'
- task: PublishBuildArtifacts@1
displayName: 'Publish Bundle Size information to Azure Dev Ops Artifacts'
inputs:
PathtoPublish: 'apps/test-bundles/dist/bundlesize.json'
ArtifactName: bundlesize-react
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact dist folder upon build for debug'
inputs:
PathtoPublish: 'apps/test-bundles/dist'
ArtifactName: distdrop-react
- template: .devops/templates/cleanup.yml
- job: build_northstar
workspace:
clean: all
timeoutInMinutes: 75
pool: '1ES-Host-Ubuntu'
steps:
- template: .devops/templates/tools.yml
- task: Bash@3
inputs:
filePath: yarn-ci.sh
displayName: yarn
- script: yarn build --to @fluentui/react-northstar
displayName: yarn build to @fluentui/react-northstar
- script: yarn workspace @fluentui/test-bundles bundle:size
displayName: yarn bundle @fluentui/test-bundles
env:
PACKAGE: '@fluentui/react-northstar'
- script: yarn bundlesizecollect
displayName: 'Collate Bundle Size Information'
- task: PublishBuildArtifacts@1
displayName: 'Publish Bundle Size information to Azure Dev Ops Artifacts'
inputs:
PathtoPublish: 'apps/test-bundles/dist/bundlesize.json'
ArtifactName: bundlesize-northstar
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact dist folder upon build for debug'
inputs:
PathtoPublish: 'apps/test-bundles/dist'
ArtifactName: distdrop-northstar
- template: .devops/templates/cleanup.yml
- job: merge
pool:
vmImage: 'windows-2019'
dependsOn:
- build_northstar
- build_react
steps:
- checkout: none
- task: DownloadPipelineArtifact@2
displayName: 'Download Pipeline Artifact: @fluentui/react'
inputs:
artifactName: 'bundlesize-react'
targetPath: '$(Build.ArtifactStagingDirectory)/react'
- task: DownloadPipelineArtifact@2
displayName: 'Download Pipeline Artifact: @fluentui/react-northstar'
inputs:
artifactName: 'bundlesize-northstar'
targetPath: '$(Build.ArtifactStagingDirectory)/react-northstar'
- script: 'chocolatey install jq'
displayName: 'Install jq'
- script: jq -c -s "reduce .[] as $item ({}; . * $item)" $(Build.ArtifactStagingDirectory)/react-northstar/bundlesize.json $(Build.ArtifactStagingDirectory)/react/bundlesize.json > $(Build.ArtifactStagingDirectory)/bundlesizes.json
displayName: 'Merge @fluentui/react, @fluentui/react-components & @fluentui/react-northstar to bundlesizes.json'
- task: PublishBuildArtifacts@1
displayName: 'Publish Merged Bundle Size information'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/bundlesizes.json'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact dist folder upon build for debug'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: distdrop
- job: lightrail
pool: server
dependsOn:
- merge
steps:
- task: odefun.odsp-lightrail-tasks-partner.odsp-lightrail-tasks-SizeAuditorWorker.SizeAuditorWorker@0
displayName: 'Size Auditor Check on LightRail'
inputs:
connectedServiceName: lowimpact
sourceVersionMessage: '$(Build.SourceVersionMessage)'
sourceRepositoryUrl: 'https://github.com/microsoft/fluentui'