Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bundle analysis collection and publish steps #3149

Merged
merged 4 commits into from
Aug 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tools/pipelines/build-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ extends:
poolBuild: Main
cgSubDirectory: packages
checkoutSubmodules: true
runBundleAnalysis: true
preCG:
- task: Npm@1
displayName: npm ci
Expand Down
23 changes: 22 additions & 1 deletion tools/pipelines/templates/build-npm-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ parameters:
type: boolean
default: true

- name: runBundleAnalysis
type: boolean
default: false

trigger: none

variables:
Expand Down Expand Up @@ -84,7 +88,7 @@ stages:

- task: UseNode@1
displayName: Use Node 12.x
inputs:
inputs:
version: 12.x

- task: Bash@3
Expand Down Expand Up @@ -213,6 +217,23 @@ stages:
ArtifactName: 'pack'
publishLocation: 'Container'

# Collect bundle analysis
- ${{ if eq(parameters.runBundleAnalysis, true) }}:
- task: Npm@1
displayName: npm run bundle-analysis
inputs:
command: 'custom'
workingDir: ${{ parameters.buildDirectory }}
customCommand: 'run bundle-analysis'

- task: PublishBuildArtifacts@1
displayName: Publish Artifacts - bundle-analysis
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

succeeded() is set based on the previous task? That's cool.

inputs:
PathtoPublish: '${{ parameters.buildDirectory }}/artifacts/bundleAnalysis'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a different path than used for the Docs one below, is that intentional? How did you choose this path?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the path to the stuff that gets published; this just happened to be where the bundle analysis stuff went. it may be better to group it all closer together? not sure it matters much though.

Artifactname: 'bundleAnalysis'
publishLocation: 'Container'

# Docs
- ${{ if ne(parameters.taskBuildDocs, false) }}:
- task: Npm@1
Expand Down