Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
80 changes: 80 additions & 0 deletions .github/workflows/perf-budgets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Performance Budgets

on:
pull_request:
branches: [ main ]
paths:
- 'frontend/**'
- '.github/workflows/perf-budgets.yml'

jobs:
build-and-test-perf:
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
cache-dependency-path: frontend/package-lock.json

- name: Install dependencies
working-directory: frontend
run: npm ci

- name: Install Playwright Browsers
working-directory: frontend
run: npx playwright install --with-deps chromium

- name: Cache Next.js build
uses: actions/cache@v4
with:
path: frontend/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('frontend/package-lock.json') }}-${{ hashFiles('frontend/**.[jt]s?(x)') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('frontend/package-lock.json') }}-

- name: Build Next.js app
working-directory: frontend
run: npm run build
env:
NEXT_PUBLIC_APP_VERSION: ${{ github.sha }}
NEXT_PUBLIC_ENV: ci

- name: Start Next.js server (background)
working-directory: frontend
run: npm run start &
env:
PORT: 3000

- name: Wait for server to be ready
run: npx wait-on tcp:3000

- name: Run Playwright Perf Tests
working-directory: frontend
env:
PERF_RESULTS_PATH: ../perf/perf-results.json
run: npx playwright test --grep "@perf"

- name: Validate Budgets
id: validate
run: node tools/scripts/validate-budgets.js
continue-on-error: true

- name: Upload artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: perf-results
path: |
frontend/test-results/
perf/perf-results.json

- name: Enforce Budgets
if: steps.validate.outcome == 'failure'
run: exit 1

3 changes: 3 additions & 0 deletions frontend/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ const nextConfig = {
],
},
assetPrefix: '',
experimental: {
instrumentationHook: true,
},
async headers() {
const corsHeaders = [
{ key: 'Access-Control-Allow-Origin', value: '*' },
Expand Down
217 changes: 214 additions & 3 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,16 @@
"@emotion/styled": "^11.13.0",
"@graphql-codegen/cli": "^6.0.1",
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/context-zone": "^1.19.0",
"@opentelemetry/core": "^1.19.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.52.1",
"@opentelemetry/instrumentation": "^0.52.1",
"@opentelemetry/instrumentation-fetch": "^0.52.1",
"@opentelemetry/resources": "^1.19.0",
"@opentelemetry/sdk-trace-base": "^1.19.0",
"@opentelemetry/sdk-trace-node": "^1.19.0",
"@opentelemetry/sdk-trace-web": "^1.19.0",
"@opentelemetry/semantic-conventions": "^1.19.0",
"@react-three/drei": "^9.97.3",
"@react-three/fiber": "^8.15.14",
"@shopify/hydrogen-react": "^2025.7.0",
Expand Down
Loading