-
-
Notifications
You must be signed in to change notification settings - Fork 425
Expand file tree
/
Copy pathlighthouse.sh
More file actions
executable file
·37 lines (33 loc) · 1.02 KB
/
lighthouse.sh
File metadata and controls
executable file
·37 lines (33 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# Run Lighthouse CI audits.
#
# Modes:
# - Accessibility (default): requires LIGHTHOUSE_COLOR_MODE (dark/light)
# - Performance: set LH_PERF=1 (no color mode needed)
#
# The LIGHTHOUSE_COLOR_MODE env var is read by lighthouse-setup.cjs
# to set the appropriate theme before each audit.
set -e
if [ -n "${LH_PERF}" ]; then
echo "⚡ Running Lighthouse performance audit (CLS)..."
pnpx @lhci/cli autorun --upload.githubStatusContextSuffix="/perf"
echo ""
echo "✅ Performance audit completed"
exit 0
fi
case "${LIGHTHOUSE_COLOR_MODE}" in
dark)
echo "🌙 Running Lighthouse accessibility audit (dark mode)..."
pnpx @lhci/cli autorun --upload.githubStatusContextSuffix="/dark"
;;
light)
echo "☀️ Running Lighthouse accessibility audit (light mode)..."
pnpx @lhci/cli autorun --upload.githubStatusContextSuffix="/light"
;;
*)
echo "⚠️ Missing or invalid LIGHTHOUSE_COLOR_MODE. Use 'dark' or 'light'."
exit 1
;;
esac
echo ""
echo "✅ Accessibility audit completed"