-
Notifications
You must be signed in to change notification settings - Fork 67
39 lines (33 loc) · 1.03 KB
/
Copy pathperformance.yml
File metadata and controls
39 lines (33 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Performance budget (#301).
#
# Enforces a client-side bundle-size budget in CI using `size-limit`
# (@size-limit/file). The job runs a real `next build` (Next.js needs
# NEXT_PUBLIC_API_URL at prerender time — the documented dev value is used
# here; it is not a secret) and then checks the measured output against the
# budgets in `.size-limit.js`. A large regression (e.g. a heavyweight
# dependency added to a route or to the shared vendor bundle) fails the check.
name: performance
on:
pull_request:
push:
branches: [main]
jobs:
size-limit:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
env:
NEXT_PUBLIC_API_URL: http://localhost:4000/api
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v7
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Build production bundle
run: npm run build
- name: Check performance budget
run: npx size-limit --json