From 0ca2cb6fca53aaa5180393ad5c91c97067cb09d1 Mon Sep 17 00:00:00 2001 From: daniel-techAI <290375699+daniel-techAI@users.noreply.github.com> Date: Sun, 2 Aug 2026 13:23:41 +0200 Subject: [PATCH] Add accessibility safeguards and site quality CI --- .github/workflows/site-quality.yml | 51 +++++ .gitignore | 2 + .htmlvalidate.json | 13 ++ README.md | 12 ++ demo-cafe.html | 4 +- demo-roofing.html | 6 +- demo-salon.html | 16 +- index.html | 34 ++-- maintenance.html | 2 +- package-lock.json | 289 +++++++++++++++++++++++++++++ package.json | 17 ++ playwright.config.mjs | 32 ++++ preview.html | 14 +- script.js | 21 ++- scripts/serve-static.mjs | 52 ++++++ share.html | 2 +- start-project.html | 4 +- styles.css | 31 +++- tests/site-quality.spec.mjs | 97 ++++++++++ 19 files changed, 653 insertions(+), 46 deletions(-) create mode 100644 .github/workflows/site-quality.yml create mode 100644 .htmlvalidate.json create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 playwright.config.mjs create mode 100644 scripts/serve-static.mjs create mode 100644 tests/site-quality.spec.mjs diff --git a/.github/workflows/site-quality.yml b/.github/workflows/site-quality.yml new file mode 100644 index 0000000..ab095a3 --- /dev/null +++ b/.github/workflows/site-quality.yml @@ -0,0 +1,51 @@ +name: Site quality + +on: + pull_request: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: site-quality-${{ github.ref }} + cancel-in-progress: true + +jobs: + validate: + name: HTML, links and accessibility + runs-on: ubuntu-latest + timeout-minutes: 15 + + steps: + - name: Check out repository + uses: actions/checkout@v7.0.1 + + - name: Set up Node.js + uses: actions/setup-node@v7.0.0 + with: + node-version: 24 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Validate HTML + run: npm run check:html + + - name: Install Chromium + run: npx playwright install --with-deps chromium + + - name: Test links and accessibility + run: npm run test:a11y + + - name: Upload failure report + if: failure() + uses: actions/upload-artifact@v7.0.1 + with: + name: playwright-report + path: playwright-report/ + if-no-files-found: ignore + retention-days: 7 diff --git a/.gitignore b/.gitignore index ee1d6d6..dc54067 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ build/ .netlify/ .wrangler/ qa/ +playwright-report/ +test-results/ diff --git a/.htmlvalidate.json b/.htmlvalidate.json new file mode 100644 index 0000000..860acf1 --- /dev/null +++ b/.htmlvalidate.json @@ -0,0 +1,13 @@ +{ + "extends": ["html-validate:recommended"], + "rules": { + "attribute-boolean-style": "off", + "doctype-style": "off", + "element-required-attributes": "error", + "no-inline-style": "off", + "prefer-native-element": "off", + "svg-focusable": "off", + "void-style": "off", + "wcag/h63": "error" + } +} diff --git a/README.md b/README.md index 1e0c67d..2a45c57 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,18 @@ The local preview opens the site directly from this folder. It does not need Nod - The site does not intentionally load third-party fonts, analytics, advertisements, maps, chat, or non-essential cookies. - The Legal Notice deliberately contains unresolved identity fields. Complete them before accepting paid work. +## Quality Checks + +Pull requests and changes to `main` run automated HTML, local-link, desktop, mobile, and WCAG A/AA checks. + +```bash +npm install +npx playwright install chromium +npm run check +``` + +The browser checks cover every public HTML page, confirm local assets remain reachable, verify the skip link and mobile menu keyboard behaviour, and use axe-core to catch automated accessibility regressions. Manual keyboard and screen-reader testing is still required before major releases. + ## Deploy This can be hosted as a static site on GitHub Pages, Cloudflare Pages, or another static host. GitHub Pages is already the active public host. diff --git a/demo-cafe.html b/demo-cafe.html index a6406d4..522e397 100644 --- a/demo-cafe.html +++ b/demo-cafe.html @@ -144,8 +144,8 @@
Reservations and orders