-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathazure-pipelines.bundlesize.yml
48 lines (43 loc) · 1.36 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
pr: none
trigger:
- main
variables:
${{ if not(startsWith(variables['Build.SourceBranch'], 'refs/heads/')) }}:
isPR: true
${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/') }}:
isPR: false
jobs:
- job: Bundle_Size
workspace:
clean: all
pool: '1ES-Host-Ubuntu'
steps:
- task: NodeTool@0
inputs:
versionSpec: '18.16.0'
checkLatest: false
displayName: 'Install Node.js'
- script: |
npm ci
displayName: Install dependencies
- script: |
npm run bundle-size
displayName: Measure bundle size
#
# Steps for "main" branch
#
- task: AzureCLI@2
displayName: Upload results (CI Only)
condition: eq(variables.isPR, false)
env:
BUNDLESIZE_ACCOUNT_NAME: $(StorageAccount)
AZURE_TENANT_ID: $(AzureTenantId)
AZURE_CLIENT_ID: $(AzureClientId)
AZURE_SERVICE_CONNECTION_ID: $(AzureServiceConnectionId)
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
inputs:
azureSubscription: 'Bundlesize Testing'
scriptType: bash
scriptLocation: 'inlineScript'
inlineScript: |
npx monosize upload-report --branch=$(Build.SourceBranchName) --commit-sha $(Build.SourceVersion) --report-files-glob="dist/bundle-size/monosize.json"