Aller au contenu

ADR 0006: Check accessibility with Lighthouse CI on every merge request

Ce contenu n’est pas encore disponible dans votre langue.

  • Status: accepted
  • Date: 2026-11-21
  • Answers: question Q7 of the project charter

Objective O5 requires a Lighthouse accessibility score of at least 90. When do we check it: once at the end of the project (issue #24), or automatically on every change of the web application?

  • Find accessibility regressions as early as possible
  • Turn the charter rule (score ≥ 90) into an automatic check
  • Stable results: a check must not fail at random
  • Limited use of CI minutes (risk R8)
  • Manual Lighthouse check at the end (issue #24)
  • Lighthouse CI job in the web pipeline
  • axe accessibility checks in end-to-end tests

Chosen option: “Lighthouse CI job in the web pipeline”, because it makes the charter rule a blocking check from the first version of the application.

  • Tool: Lighthouse CI (@lhci/cli, command lhci autorun), run on the production build of web.
  • The job runs only in merge request pipelines and on main.
  • Assertions:
Category Level Minimum score
Accessibility error (blocks the merge request) 0.9
Best practices error (blocks the merge request) 0.9
Performance warning only 0.8
SEO warning only 0.9
  • Performance is only a warning, because its score changes from one run to the next on shared CI runners.
  • The HTML reports are kept as job artifacts, so each merge request has its report.
  • The job is a shared template in ci-templates (lighthouse.yml), ready for the next projects.

axe checks in end-to-end tests are a possible next step: they can check states that Lighthouse does not see (open dialog, widget in error, keyboard move mode).

  • Good: an accessibility regression cannot be merged.
  • Good: a report for every merge request, visible to reviewers.
  • Good: reusable for JobRadar and Sinistra.
  • Bad: about one or two more CI minutes per pipeline of web.
  • Bad: Lighthouse CI bundles its own Lighthouse version, which can be older than the one in Chrome DevTools: scores may differ slightly.
  • Bad: Lighthouse only checks the page as loaded; a score of 100 does not mean full WCAG compliance. The manual keyboard test of issue #24 stays.
  • Good: nothing to set up.
  • Bad: a regression added early is found late, when it costs more to fix.
  • Good: automatic, blocking, with a report for every merge request.
  • Bad: CI minutes; performance score not stable enough to block.
  • Good: checks several states of the interface, not only the first load.
  • Bad: needs end-to-end tests first; planned later.