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 f17b845..6db5330 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,5 @@ coverage/ # Local visual-regression artifacts 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 0cf3aa4..e0ef826 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,22 @@ The check verifies required page metadata, unique IDs, local links and assets, C ## Form and privacy behavior -Public enquiry forms do not transmit or store submissions. They open a pre-filled `mailto:` draft, which the visitor must review and send. Demo forms only display an on-page demonstration message. If a backend, analytics, payments, booking, chat, or other third-party service is added, review the privacy, cookie, security, and deployment documentation before enabling it. +Public enquiry forms do not transmit or store submissions. They open a pre-filled `mailto:` draft, +which the visitor must review and send. Demo forms only display an on-page demonstration message. If +a backend, analytics, payments, booking, chat, or other third-party service is added, review the +privacy, cookie, security, and deployment documentation before enabling it. + +## 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. ## Deployment diff --git a/demo-cafe.html b/demo-cafe.html index 59b9c36..bdc4b3d 100644 --- a/demo-cafe.html +++ b/demo-cafe.html @@ -145,8 +145,8 @@
Reservations and orders