Skip to content

Commit dcbb0d6

Browse files
authored
ci: split a11y tests using matrix (#819)
1 parent 5f105bb commit dcbb0d6

2 files changed

Lines changed: 20 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ jobs:
9292

9393
a11y:
9494
runs-on: ubuntu-latest
95+
strategy:
96+
matrix:
97+
mode: [dark, light]
9598

9699
steps:
97100
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
@@ -111,10 +114,11 @@ jobs:
111114
- name: 🏗️ Build project
112115
run: pnpm build
113116

114-
- name: ♿ Accessibility audit (Lighthouse - dark & light mode)
117+
- name: ♿ Accessibility audit (Lighthouse - ${{ matrix.mode }} mode)
115118
run: ./scripts/lighthouse-a11y.sh
116119
env:
117120
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
121+
LIGHTHOUSE_COLOR_MODE: ${{ matrix.mode }}
118122

119123
knip:
120124
runs-on: ubuntu-latest

scripts/lighthouse-a11y.sh

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,20 @@
77

88
set -e
99

10-
echo "🌙 Running Lighthouse accessibility audit (dark mode)..."
11-
LIGHTHOUSE_COLOR_MODE=dark pnpx @lhci/cli autorun --upload.githubStatusContextSuffix="/dark"
10+
case "${LIGHTHOUSE_COLOR_MODE}" in
11+
dark)
12+
echo "🌙 Running Lighthouse accessibility audit (dark mode)..."
13+
pnpx @lhci/cli autorun --upload.githubStatusContextSuffix="/dark"
14+
;;
15+
light)
16+
echo "☀️ Running Lighthouse accessibility audit (light mode)..."
17+
pnpx @lhci/cli autorun --upload.githubStatusContextSuffix="/light"
18+
;;
19+
*)
20+
echo "⚠️ Missing or invalid LIGHTHOUSE_COLOR_MODE. Use 'dark' or 'light'."
21+
exit 1
22+
;;
23+
esac
1224

1325
echo ""
14-
echo "☀️ Running Lighthouse accessibility audit (light mode)..."
15-
LIGHTHOUSE_COLOR_MODE=light pnpx @lhci/cli autorun --upload.githubStatusContextSuffix="/light"
16-
17-
echo ""
18-
echo "✅ Accessibility audits completed for both color modes"
26+
echo "✅ Accessibility audit completed"

0 commit comments

Comments
 (0)