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:
required: false
description: 'whether to skip building native modules'
type: string
uploadAnalyzerArtifacts:
required: false
description: 'whether to upload analyzer artifacts'
type: string
skipForDocsOnly:
required: false
description: 'skip for docs only changes'
......@@ -166,7 +170,7 @@ jobs:
- run: pnpm install
if: ${{ inputs.skipInstallBuild != 'yes' }}
- run: pnpm build
- run: ANALYZE=1 pnpm build
if: ${{ inputs.skipInstallBuild != 'yes' }}
- run: pnpm playwright install-deps
......@@ -186,6 +190,13 @@ jobs:
name: turbo run summary
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
uses: actions/upload-artifact@v3
if: ${{ inputs.afterBuild }}
......
......@@ -26,6 +26,7 @@ jobs:
secrets: inherit
with:
uploadSwcArtifact: 'yes'
uploadAnalyzerArtifacts: 'yes'
stats:
name: PR Stats
......
......@@ -187,6 +187,19 @@ module.exports = ({ dev, turbo, bundleType, experimental }) => {
bundleType
),
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),
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