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
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,28 @@ jobs:
- run: pnpm install --frozen-lockfile
- run: pnpm check
- run: pnpm build

# The page's budget: 100 in Lighthouse, with a little slack for the runner. Its own job, so a slow
# runner never hides a type error, and the reports are kept either way.
lighthouse:
name: Lighthouse
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
with:
version: 12.16.0
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: 24.22.2
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm build
- run: pnpm lighthouse
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: always()
with:
name: lighthouse-reports
path: lighthouse-reports/
retention-days: 14
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ dist/
node_modules/
.astro/
.DS_Store
lighthouse-reports/
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ pnpm build # dist/
The 3D scene (`src/scripts/landing/scene.ts`) runs in a Web Worker on an OffscreenCanvas where the
browser supports it, and on the page otherwise; `scene-client.ts` decides and `scene-worker.ts` is the
worker. Either way the page paints its hero on the first frame and never blocks on three.js, which is
what keeps Lighthouse at 100 on mobile. Measure with `pnpm build && pnpm preview` and Lighthouse
against `http://localhost:4321/`; the Cloudflare beacon is the one request that fails offline.
what keeps Lighthouse at 100 on mobile. `pnpm build && pnpm lighthouse` measures it the way CI does
(`scripts/lighthouse.mjs`: the mobile default and the desktop preset, median of three runs, reports in
`lighthouse-reports/`) and fails under the budget set there: 95 in performance, 100 in the rest. The
Cloudflare beacon is kept out of the audit, so the check works offline and never fails on a third party.

pnpm, like the framework repository, and not only for consistency: `npm ci` cannot install this
tree on Linux from a lockfile resolved on macOS, because rolldown ships its native bindings as
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"dev": "astro dev --host",
"build": "astro build",
"check": "astro check",
"preview": "astro preview"
"preview": "astro preview",
"lighthouse": "node scripts/lighthouse.mjs"
},
"dependencies": {
"astro": "7.4.2",
Expand All @@ -17,6 +18,7 @@
"@astrojs/check": "0.9.12",
"@astrojs/sitemap": "3.7.4",
"@types/three": "0.186.0",
"lighthouse": "13.6.0",
"typescript": "5.9.3",
"wrangler": "4.152.0"
}
Expand Down
Loading
Loading