Skip to content
Closed
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
39 changes: 39 additions & 0 deletions .github/workflows/lhci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: UI Audit & Quality Assurance Gates

on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]

jobs:
lighthouse-audit:
name: Run Performance & Accessibility Gateways
runs-on: ubuntu-latest

steps:
- name: Checkout Source Code Repository
uses: actions/checkout@v4

- name: Setup Node.js Runtime Environment
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'

- name: Install Application Dependencies
run: npm ci

# Compile production build assets
- name: Compile Production Application Build
run: npm run build
env:
NEXT_PUBLIC_DISABLE_ANALYTICS: true

# Orchestrate background server lifecycle and run Lighthouse CI
- name: Run Lighthouse Audit Assertions Matrix
run: |
npx start-server-and-test \
'npm run start' \
http://127.0.0.1:3000 \
'npx @lhci/cli@0.13.x autorun'
21 changes: 21 additions & 0 deletions lighthouserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
ci: {
collect: {
// Build directory location where the production app compiles
staticDistDir: './out',
numberOfRuns: 3,
},
assert: {
// Enforce zero tolerance for regression dropping below target parameters
assertions: {
'categories:performance': ['error', { minScore: 0.85 }],
'categories:accessibility': ['error', { minScore: 0.95 }],
'categories:best-practices': ['error', { minScore: 0.90 }],
'categories:seo': ['off'], // Can be tuned to 'warn' or 'error' if needed later
},
},
upload: {
target: 'temporary-public-storage', // Saves HTML trace artifact summaries for review on failure
},
},
};
Loading