-
Notifications
You must be signed in to change notification settings - Fork 2.7k
/
azure-pipelines.bundlesize.yml
66 lines (56 loc) · 2.1 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
pr: none
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)
- task: AzureCLI@2
displayName: upload a report (base only)
condition: eq(variables.isPR, false)
env:
AZURE_TENANT_ID: $(AzureTenantId)
AZURE_CLIENT_ID: $(AzureClientId)
AZURE_SERVICE_CONNECTION_ID: $(AzureServiceConnectionId)
BUNDLESIZE_ACCOUNT_NAME: $(StorageAccount)
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
inputs:
azureSubscription: 'Bundlesize Testing'
scriptType: bash
scriptLocation: 'inlineScript'
inlineScript: |
yarn monosize upload-report --branch=$(Build.SourceBranchName) --commit-sha $(Build.SourceVersion)
- template: .devops/templates/cleanup.yml