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
17 changes: 14 additions & 3 deletions .github/workflows/run-ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -492,15 +492,26 @@ jobs:
- name: Check out repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8

- name: Install pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda
with:
run_install: true
version: 10

- name: Set up Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
cache-dependency-path: frontend/pnpm-lock.yaml
cache: 'pnpm'
node-version: 22

- name: Run Lighthouse CI
working-directory: frontend
- name: Run lighthouse-ci
env:
LHCI_BASE_URL: 'https://nest.owasp.dev'
run: |
npx -y @lhci/cli@0.15.1 autorun
pnpm run lighthouse-ci
timeout-minutes: 15
working-directory: frontend

build-production-images:
name: Build Production Images
Expand Down
1 change: 1 addition & 0 deletions cspell/custom-dict.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jumpstart
kasya
lhci
libexpat
lighthouseci
linkify
lte
lxml
Expand Down
5 changes: 4 additions & 1 deletion frontend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ format-frontend-code:
&& pnpm run format))

lighthouse-ci:
@cd frontend && npx -y @lhci/cli@0.15.1 autorun --collect.url=http://localhost:3000
@cd frontend && pnpm run lighthouse-ci

lighthouse-ci-desktop:
@cd frontend && pnpm run lighthouse-ci:desktop

lint-frontend-code:
@(cd frontend && pnpm run lint:check >/dev/null 2>&1 \
Expand Down
37 changes: 37 additions & 0 deletions frontend/lighthouserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const LHCI_BASE_URL = process.env.LHCI_BASE_URL || 'http://localhost:3000'
const LHCI_CHROME_FLAGS =
process.env.LHCI_CHROME_FLAGS || '--disable-dev-shm-usage --headless --no-sandbox'

const URL_PATHS = [
'/',
'/about',
'/chapters',
'/contribute',
'/members',
'/organizations',
'/projects',
'/snapshots',
]

module.exports = {
ci: {
assert: {
assertions: {
'categories:accessibility': ['warn', { minScore: 0.9 }],
'categories:best-practices': ['warn', { minScore: 0.9 }],
'categories:performance': ['warn', { minScore: 0.9 }],
'categories:seo': ['warn', { minScore: 0.9 }],
},
},
collect: {
numberOfRuns: 1,
settings: {
chromeFlags: LHCI_CHROME_FLAGS,
},
url: URL_PATHS.map((url_path) => `${LHCI_BASE_URL}${url_path}`),
},
upload: {
target: 'temporary-public-storage',
},
},
}
19 changes: 0 additions & 19 deletions frontend/lighthouserc.json

This file was deleted.

3 changes: 3 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"dev": "next dev --port 3000",
"format": "prettier --log-level warn --write .",
"format:check": "prettier --check .",
"lighthouse-ci": "lhci autorun",
"lighthouse-ci:desktop": "lhci autorun --collect.settings.preset=desktop",
Comment on lines +11 to +12
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between those 2 targets? Do we need the desktop preset for local running?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default, lighthouse opens all pages as a mobile device, this is if we want to test the desktop version

Copy link
Collaborator Author

@rudransh-shrivastava rudransh-shrivastava Aug 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not required, testing as a mobile device is enough but I think accessibility and some UI may differ for both devices, it's a good to have

"lint": "eslint . --config eslint.config.mjs --fix --max-warnings=0",
"lint:check": "eslint . --config eslint.config.mjs --max-warnings=0",
"start": "next start",
Expand Down Expand Up @@ -66,6 +68,7 @@
"@axe-core/react": "^4.10.2",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.34.0",
"@lhci/cli": "^0.15.1",
"@playwright/test": "^1.55.0",
"@swc/core": "^1.13.5",
"@swc/jest": "^0.2.39",
Expand Down
Loading