Skip to content
Draft
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
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,11 @@ jobs:
NODE_OPTIONS: '--max_old_space_size=4096'
# We want to ensure that static exports for all locales do not occur on `pull_request` events
NEXT_PUBLIC_STATIC_EXPORT_LOCALE: ${{ github.event_name == 'push' }}
# See https://github.com/vercel/next.js/pull/81318
TURBOPACK_STATS: ${{ matrix.os == 'ubuntu-latest' }}

- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
if: matrix.os == 'ubuntu-latest'
with:
name: webpack-stats
path: apps/site/.next/server/webpack-stats.json
55 changes: 55 additions & 0 deletions .github/workflows/bundle-compare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Compare Bundle Size

on:
pull_request:
# workflow_run:
# workflows: ['Build']
# types: [completed]

permissions:
contents: read
actions: read
# To create the comment
pull-requests: write

jobs:
compare:
name: Compare Bundle Stats
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit

- name: Download Stats (HEAD)
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: webpack-stats
path: head-stats
run-id: 18860058714
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Get Run ID from BASE
id: base-run
env:
WORKFLOW_ID: ${{ github.event.workflow_run.workflow_id || 64771488 }}
GH_TOKEN: ${{ github.token }}
run: |
ID=$(gh run list --repo $GITHUB_REPOSITORY -c 95f43b01b7790b2af237d3dd6f015d2212dd495f -w $WORKFLOW_ID -L 1 --json databaseId --jq ".[].databaseId")
echo "run_id=$ID" >> $GITHUB_OUTPUT

- name: Download Stats (BASE)
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: webpack-stats
path: base-stats
run-id: ${{ steps.base-run.outputs.run_id }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- uses: github/webpack-bundlesize-compare-action@89161bb25577f08577ce053c3264c0e3b7d7558f # v2.1.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
current-stats-json-path: ./head-stats/webpack-stats.json
base-stats-json-path: ./base-stats/webpack-stats.json
12 changes: 8 additions & 4 deletions apps/site/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"NEXT_PUBLIC_ORAMA_ENDPOINT",
"NEXT_PUBLIC_DATA_URL",
"TURBO_CACHE",
"TURBO_TELEMETRY_DISABLED"
"TURBO_TELEMETRY_DISABLED",
"TURBOPACK_STATS"
]
},
"build": {
Expand All @@ -45,7 +46,8 @@
"NEXT_PUBLIC_ORAMA_ENDPOINT",
"NEXT_PUBLIC_DATA_URL",
"TURBO_CACHE",
"TURBO_TELEMETRY_DISABLED"
"TURBO_TELEMETRY_DISABLED",
"TURBOPACK_STATS"
]
},
"start": {
Expand All @@ -64,7 +66,8 @@
"NEXT_PUBLIC_ORAMA_ENDPOINT",
"NEXT_PUBLIC_DATA_URL",
"TURBO_CACHE",
"TURBO_TELEMETRY_DISABLED"
"TURBO_TELEMETRY_DISABLED",
"TURBOPACK_STATS"
]
},
"deploy": {
Expand All @@ -89,7 +92,8 @@
"NEXT_PUBLIC_ORAMA_ENDPOINT",
"NEXT_PUBLIC_DATA_URL",
"TURBO_CACHE",
"TURBO_TELEMETRY_DISABLED"
"TURBO_TELEMETRY_DISABLED",
"TURBOPACK_STATS"
]
},
"lint:js": {
Expand Down
Loading