forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.bundlesize.yml
100 lines (83 loc) · 3.29 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
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: bundle_size
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 monosize 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: 'node_modules/monosize/dist/monosize.md'
status: 'success'
uniqueId: 'bundleSizeComment9423'
- script: |
yarn monosize 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)
BUNDLESIZE_ACCOUNT_NAME: fluentbundlesize
- template: .devops/templates/cleanup.yml
- job: bundle_size_auditor
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
# we cannot use `--since` because the ligtrail service would calculate packages not build as a removal 🚨 - thus giving lot of noise and incorrect metrics on every PR
- script: yarn lage bundle-size-auditor
displayName: build packages & create reports
- script: yarn bundle-size-auditor --create-report --report-path dist/bundle-size-auditor
displayName: 'Merge generated bundlesize.json into bundlesizes.json'
- task: PublishBuildArtifacts@1
displayName: 'Publish Merged Bundle Size information for lightrail processing'
inputs:
PathtoPublish: 'dist/bundle-size-auditor/bundlesizes.json'
ArtifactName: drop
- task: PublishBuildArtifacts@1
displayName: 'Publish bundled artifacts for debug'
inputs:
PathtoPublish: 'dist/bundle-size-auditor'
ArtifactName: distdrop
- template: .devops/templates/cleanup.yml
- job: lightrail
pool: server
dependsOn:
- bundle_size_auditor
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'