diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f5a5b266c..e686ad6999 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,3 +73,25 @@ jobs: - name: 🖥️ Test project (browser) run: pnpm test:browser + + a11y: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + - run: corepack enable + - uses: actions/setup-node@v6 + with: + node-version: lts/* + cache: pnpm + + - name: 📦 Install dependencies + run: pnpm install + + - name: 🏗️ Build project + run: pnpm build + + - name: ♿ Accessibility audit (Lighthouse) + run: pnpx @lhci/cli autorun + env: + LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} diff --git a/.gitignore b/.gitignore index 8c08c5565c..2ccbc2c502 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,6 @@ coverage/ # Playwright playwright-report/ test-results/ + +# Lighthouse +.lighthouseci diff --git a/.lighthouserc.json b/.lighthouserc.json new file mode 100644 index 0000000000..bf57ec409a --- /dev/null +++ b/.lighthouserc.json @@ -0,0 +1,26 @@ +{ + "ci": { + "collect": { + "startServerCommand": "pnpm preview", + "startServerReadyPattern": "Listening", + "url": [ + "http://localhost:3000/", + "http://localhost:3000/search?q=nuxt", + "http://localhost:3000/nuxt" + ], + "numberOfRuns": 1, + "settings": { + "onlyCategories": ["accessibility"], + "skipAudits": ["valid-source-maps"] + } + }, + "assert": { + "assertions": { + "categories:accessibility": ["warn", { "minScore": 0.9 }] + } + }, + "upload": { + "target": "temporary-public-storage" + } + } +}