Skip to content
Merged
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
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ jobs:
CODING_SH_REQUIRE_DIST: "1"
run: npm run check

# The Site workflow runs this on main and stops the deploy when a page is over budget.
# Running it here, on the same OS and Node as that workflow, fails the pull request instead.
- name: Site perf budget
if: matrix.shard == 1 && runner.os == 'Linux' && matrix.node == '24.x'
working-directory: apps/site
run: npm run perf:budget

# The built output holds nothing shaped like a secret.
- name: Secret scan of the built output
if: matrix.shard == 1
Expand Down
3 changes: 2 additions & 1 deletion apps/site/scripts/perf-budget.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ const BUDGET = {
// troubleshooting, which gains an entry per failure a new feature can show
// (27.8KB with the 0.1.6 entries). Raised from 26KB for those three.
// Troubleshooting is 30.5KB after the docs rebuild of 2026-11-11, so 33KB.
// /docs/api/read is 30.3KB with the weight edit and checkpoint fields, so 33KB.
htmlBrotli: {
"/": 24.5 * KB,
"/docs/cli/": 30 * KB,
"/docs/api/": 30 * KB,
"/docs/api/read/": 30 * KB,
"/docs/api/read/": 33 * KB,
"/docs/api/read/search/": 30 * KB,
"/docs/troubleshooting/": 33 * KB,
other: 26 * KB,
Expand Down
2 changes: 1 addition & 1 deletion docs/perf.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ page has its own blocking-time budget on the slow phone. The rules are in
|---|---|
| Pull requests | GitHub's hosted runners. Load-time budgets are skipped: they only hold on our own machine. |
| Pushes to main | The one desk runner labelled `perf`, so two perf runs never overlap. CI and deploys run beside it. |
| Deploys | `npm run perf:budget` in apps/site checks page weight, inline CSS and script, fonts, scripts and images in the build. |
| Pull requests and deploys | `npm run perf:budget` in apps/site checks page weight, inline CSS and script, fonts, scripts and images in the build. CI runs it on every pull request, and the Site workflow runs it again before a deploy. |

The desk runs other jobs, so each sample records `cpu_busy`, the share of CPU in use while the
page loaded. A load-time budget counts only samples at 0.5 or less (`--quiet-cpu`). When fewer
Expand Down
Loading