Skip to content

Make VitePress docs fully WCAG 2.1 AA accessible #4

Make VitePress docs fully WCAG 2.1 AA accessible

Make VitePress docs fully WCAG 2.1 AA accessible #4

Workflow file for this run

name: Responsive
# Prevents horizontal overflow regressions at common mobile/tablet viewport sizes.
# Runs Playwright against a VitePress preview build for every push or PR that
# touches the docs source or this workflow file.
on:
push:
paths:
- "docs/**"
- "playwright.config.ts"
- "scripts/responsive.pw.ts"
- ".github/workflows/responsive.yml"
pull_request:
paths:
- "docs/**"
- "playwright.config.ts"
- "scripts/responsive.pw.ts"
- ".github/workflows/responsive.yml"
jobs:
responsive:
name: No horizontal scroll (mobile viewports)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@ecf28ddc73e819eb6fa29df6b34ef8921c743461 # v2.1.3
- name: Install dependencies
run: bun install --frozen-lockfile
# Build the docs with localhost URLs so the embedded sitemap + internal
# links all resolve against the local preview server.
- name: Build docs (localhost URLs)
run: bun run docs:build:a11y
# Install only the Chromium browser — keeps the job fast (~150 MB vs 700 MB).
- name: Install Playwright (Chromium only)
run: bunx playwright install --with-deps chromium
# Start the preview server in the background on port 4173.
- name: Start VitePress preview
run: bun run docs:preview -- --port 4173 &
# Give the server a moment to be ready.
- name: Wait for preview server
run: |
for i in $(seq 1 10); do
curl -s http://localhost:4173/github-code-search/ > /dev/null && echo "Server ready" && break
echo "Waiting ($i/10)…"
sleep 2
done
- name: Run responsive tests
run: bun run docs:test:responsive
env:
PLAYWRIGHT_BASE_URL: http://localhost:4173
# Upload the Playwright HTML report as a workflow artifact so failing
# screenshots can be inspected without having to run locally.
- name: Upload Playwright report
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
retention-days: 7