Skip to content

Commit 207201c

Browse files
committed
Add Unlighthouse CI workflow for site scans
This commit introduces an Unlighthouse GitHub Actions workflow to automate site performance checks. It configures dependency installation, builds a static preview, and generates a report with a performance budget. Updates to `.gitignore` account for new Unlighthouse-related files.
1 parent b303e6b commit 207201c

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

.github/workflows/unlighouse.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Unlighthouse Site Scan
2+
on: [push]
3+
4+
jobs:
5+
unlighthouse-site-scan:
6+
runs-on: ubuntu-latest
7+
timeout-minutes: 10
8+
9+
steps:
10+
- name: Checkout Repository
11+
uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 1
14+
15+
- name: Setup Bun
16+
uses: oven-sh/setup-bun@v2
17+
18+
- name: Install Dependencies
19+
run: bun install -g @unlighthouse/cli puppeteer
20+
21+
- name: Build SvelteKit Preview
22+
run: make build
23+
24+
# Run build in background and log output
25+
- name: Start Preview Server
26+
run: |
27+
bun run preview --port 4173 &
28+
echo "Waiting for preview to start on port 4173…"
29+
bunx wait-on http://localhost:4173
30+
31+
- name: Run Unlighthouse Assertions & Generate Static Report
32+
run: unlighthouse-ci --site http://localhost:4173 --budget 75 --build-static
33+
34+
- name: Upload Unlighthouse Report
35+
uses: actions/upload-artifact@v4
36+
if: ${{ !cancelled() }}
37+
with:
38+
name: unlighthouse-report
39+
path: .unlighthouse/
40+
retention-days: 30

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,7 @@ Thumbs.db
2222
# Vite
2323
vite.config.js.timestamp-*
2424
vite.config.ts.timestamp-*
25-
.wrangler
25+
.wrangler
26+
27+
# Unlighthouse
28+
.unlighthouse

0 commit comments

Comments
 (0)