forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.bundlesize.yml
61 lines (50 loc) · 1.9 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
pr:
- master
trigger:
- master
variables:
- ${{ if not(startsWith(variables['Build.SourceBranch'], 'refs/heads/')) }}:
- name: sinceArg
value: --base $(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 nx affected -t bundle-size --nxBail $(sinceArg)
displayName: build packages & create reports
condition: eq(variables.isPR, true)
- script: |
npx monosize compare-reports --branch=$(System.PullRequest.TargetBranch) --output=markdown --quiet > ./monosize-report.md
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: 'monosize-report.md'
status: 'success'
uniqueId: 'bundleSizeComment9423'
- script: |
yarn nx run-many -t bundle-size --nxBail
displayName: build all packages & create reports
condition: eq(variables.isPR, false)
- 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