Skip to content

Commit 68d6a58

Browse files
committed
feat: Add Lighthouse CI workflow for performance testing
- Add GitHub Actions workflow for automated Lighthouse audits - Configure Lighthouse CI with performance, accessibility, SEO, and best practices checks - Add lighthouse npm script for local testing - Update dependencies with @lhci/cli and lighthouse packages - Configure .gitignore to exclude lighthouse reports - Update README with testing information The workflow runs on: - Pull requests to master - Pushes to master and lighthouse-ci-only branch - Manual workflow dispatch Lighthouse thresholds: - Performance: 60% (warn) - Accessibility: 80% (warn) - Best Practices: 70% (warn) - SEO: 70% (warn)
1 parent cbcdef8 commit 68d6a58

File tree

5 files changed

+14
-0
lines changed

5 files changed

+14
-0
lines changed

.github/workflows/lighthouse-ci.yml

Whitespace-only changes.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
# testing
99
/coverage
1010

11+
# lighthouse
12+
/.lighthouseci
13+
/lighthouse-reports
14+
1115
# next.js
1216
/.next/
1317
/out/

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ You can start editing the page by modifying `pages/index.js`. The page auto-upda
3636

3737
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
3838

39+
## Testing
40+
41+
This project includes automated testing:
42+
- **Cypress**: End-to-end testing (`npm run cy:run`)
43+
- **Lighthouse**: Performance, accessibility, and SEO auditing (runs automatically in CI)
44+
3945
## AsyncAPI Contributors ✨
4046

4147
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

lighthouserc.json

Whitespace-only changes.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
"generate:assets": "echo \"No assets to configure\"",
1414
"test": "echo \"No tests configured yet\"",
1515
"cy:open": "cypress open",
16+
"cy:run": "cypress run",
17+
"lighthouse": "lhci autorun",
1618
"release": "echo \"No release to npm for this project\""
1719
},
1820
"dependencies": {
@@ -32,12 +34,14 @@
3234
"react-slick": "^0.29.0"
3335
},
3436
"devDependencies": {
37+
"@lhci/cli": "^0.13.0",
3538
"@types/nodemailer": "^6.4.17",
3639
"@types/react-slick": "^0.23.13",
3740
"autoprefixer": "^10.4.7",
3841
"cypress": "^13.11.0",
3942
"eslint": "8.15.0",
4043
"eslint-config-next": "13.1.1",
44+
"lighthouse": "^11.4.0",
4145
"postcss": "^8.4.31",
4246
"prettier": "^3.5.3",
4347
"tailwindcss": "^3.0.24",

0 commit comments

Comments
 (0)