Unverified Commit 56d74f42 authored by Zack Tanner's avatar Zack Tanner Committed by GitHub

bundle analyzer artifacts (#57307)

This uploads bundle analyzer artifacts during CI
parent c77fec82
...@@ -21,6 +21,10 @@ on: ...@@ -21,6 +21,10 @@ on:
required: false required: false
description: 'whether to skip building native modules' description: 'whether to skip building native modules'
type: string type: string
uploadAnalyzerArtifacts:
required: false
description: 'whether to upload analyzer artifacts'
type: string
skipForDocsOnly: skipForDocsOnly:
required: false required: false
description: 'skip for docs only changes' description: 'skip for docs only changes'
...@@ -166,7 +170,7 @@ jobs: ...@@ -166,7 +170,7 @@ jobs:
- run: pnpm install - run: pnpm install
if: ${{ inputs.skipInstallBuild != 'yes' }} if: ${{ inputs.skipInstallBuild != 'yes' }}
- run: pnpm build - run: ANALYZE=1 pnpm build
if: ${{ inputs.skipInstallBuild != 'yes' }} if: ${{ inputs.skipInstallBuild != 'yes' }}
- run: pnpm playwright install-deps - run: pnpm playwright install-deps
...@@ -186,6 +190,13 @@ jobs: ...@@ -186,6 +190,13 @@ jobs:
name: turbo run summary name: turbo run summary
path: .turbo/runs path: .turbo/runs
- name: Upload bundle analyzer artifacts
uses: actions/upload-artifact@v3
if: ${{ inputs.uploadAnalyzerArtifacts == 'yes' }}
with:
name: webpack bundle analysis stats
path: packages/next/dist/compiled/next-server/report.*.html
- name: Upload test reports artifact - name: Upload test reports artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
if: ${{ inputs.afterBuild }} if: ${{ inputs.afterBuild }}
......
...@@ -26,6 +26,7 @@ jobs: ...@@ -26,6 +26,7 @@ jobs:
secrets: inherit secrets: inherit
with: with:
uploadSwcArtifact: 'yes' uploadSwcArtifact: 'yes'
uploadAnalyzerArtifacts: 'yes'
stats: stats:
name: PR Stats name: PR Stats
......
...@@ -187,6 +187,19 @@ module.exports = ({ dev, turbo, bundleType, experimental }) => { ...@@ -187,6 +187,19 @@ module.exports = ({ dev, turbo, bundleType, experimental }) => {
bundleType bundleType
), ),
openAnalyzer: false, openAnalyzer: false,
...(process.env.CI
? {
analyzerMode: 'static',
reportFilename: path.join(
__dirname,
`dist/compiled/next-server/report.${dev ? 'dev' : 'prod'}-${
turbo ? 'turbo' : 'webpack'
}-${
experimental ? 'experimental' : 'stable'
}-${bundleType}.html`
),
}
: {}),
}), }),
].filter(Boolean), ].filter(Boolean),
stats: { stats: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment