Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c991011
feat: add axe-core WCAG 2.2 AA accessibility tests to CI
lowlydba Jun 17, 2026
28f85f8
docs: add WCAG 2.2 AA badge to README
lowlydba Jun 17, 2026
1b9b2d9
fix: resolve 3 WCAG 2.2 AA violations caught by axe CI
lowlydba Jun 17, 2026
e093942
fix: prevent path traversal in a11y test static server (CodeQL js/pat…
lowlydba Jun 17, 2026
81c1e82
chore: move CODEOWNERS and SECURITY.md to .github/
lowlydba Jun 17, 2026
bce69b7
feat: add DuckDB query smoke tests to CI
lowlydba Jun 17, 2026
4f71687
fix: correct setup-python version comment (v5.6.0 not v6.2.0)
lowlydba Jun 17, 2026
012b925
chore: consolidate CI into single workflow with are-we-good rollup
lowlydba Jun 17, 2026
a79cc31
chore: add 15 minute timeout to DuckDB query tests job
lowlydba Jun 17, 2026
380b07b
test: expand a11y coverage to 7 pages
lowlydba Jun 17, 2026
5818492
fix(a11y): fix WCAG AA violations on community page
lowlydba Jun 17, 2026
397cde8
chore(query-tests): print query SQL and elapsed time per run
lowlydba Jun 17, 2026
abeb466
fix(a11y): resolve code-block, link, email, and iframe WCAG violations
lowlydba Jun 17, 2026
e67b6ae
chore: remove ponytail comment markers
lowlydba Jun 17, 2026
40425b1
fix(query-tests): stream output live and print setup timing
lowlydba Jun 17, 2026
0beba9d
feat(query-tests): colorize printed SQL to set it apart from log lines
lowlydba Jun 17, 2026
7c1beab
fix(query-tests): print the exact SQL that executes
lowlydba Jun 17, 2026
3f0b946
fix(query-tests): strip 'LOAD ...; --noqa' preamble so queries get LI…
lowlydba Jun 17, 2026
1bc9f03
perf(query-tests): use LIMIT 0 instead of LIMIT 1
lowlydba Jun 17, 2026
37e7f49
fix(query-tests): unwrap COPY queries with leading comments, add --dr…
lowlydba Jun 17, 2026
775da80
fix(divisions): wire up orphaned count queries, drop dead SQL fragments
lowlydba Jun 17, 2026
d112c54
fix(divisions): shorten new count-tab labels so they don't truncate
lowlydba Jun 17, 2026
cc6276a
fix(query-tests): use AWS S3 path for Detroit and Seattle building qu…
lowlydba Jun 17, 2026
100ed22
perf(query-tests): wrap COPY selects in LIMIT 0 for multi-statement s…
lowlydba Jun 17, 2026
eb46c7a
fix(a11y): harden static server and dedupe Tabs default
lowlydba Jun 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/a11y.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Accessibility

on:
pull_request:
workflow_dispatch:

concurrency:
group: a11y-${{ github.event.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
a11y:
name: WCAG 2.2 AA
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: package.json

- name: Configure sustainable npm
uses: lowlydba/sustainable-npm@31d51025884f424f58f22e4e6578178bb4e79632 # v3.0.0

- name: Install NPM dependencies
run: npm ci

- name: Build
run: npm run build

- name: Install Playwright browser
run: npx playwright install chromium --with-deps

- name: Run accessibility tests
run: npm run test:a11y
102 changes: 102 additions & 0 deletions __tests__/a11y.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/**
* WCAG 2.2 AA accessibility tests using Node's built-in test runner.
* Requires a built `build/` directory — run `npm run build` first.
* Run with: npm run test:a11y
*/

import { test, before, after } from 'node:test';
import assert from 'node:assert/strict';
import { createServer } from 'node:http';
import { readFile, access } from 'node:fs/promises';
import { extname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { chromium } from 'playwright';
import AxeBuilder from '@axe-core/playwright';

const __dirname = fileURLToPath(new URL('.', import.meta.url));
const BUILD_DIR = join(__dirname, '..', 'build');
const PORT = 3778;
const BASE_URL = `http://localhost:${PORT}`;

const MIME = {
'.html': 'text/html',
'.js': 'application/javascript',
'.mjs': 'application/javascript',
'.css': 'text/css',
'.png': 'image/png',
'.svg': 'image/svg+xml',
'.woff2': 'font/woff2',
'.json': 'application/json',
};

let server, browser;

before(async () => {
await access(join(BUILD_DIR, 'index.html')).catch(() => {
throw new Error(`build/index.html not found — run 'npm run build' before running accessibility tests`);
});

// ponytail: minimal static file server, falls back to index.html for Docusaurus client-side routing
server = createServer(async (req, res) => {
const urlPath = req.url.split('?')[0];
Comment thread
Copilot marked this conversation as resolved.
Outdated
const filePath = join(BUILD_DIR, urlPath === '/' ? 'index.html' : urlPath);
try {
const data = await readFile(filePath);

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression High test

This path depends on a
user-provided value
.
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
res.writeHead(200, { 'Content-Type': MIME[extname(filePath)] ?? 'application/octet-stream' });
res.end(data);
} catch {
try {
const data = await readFile(join(BUILD_DIR, 'index.html'));
res.writeHead(200, { 'Content-Type': 'text/html' });
res.end(data);
} catch {
res.writeHead(404);
res.end('Not found');
}
}
Comment thread
lowlydba marked this conversation as resolved.
});
await new Promise((resolve) => server.listen(PORT, resolve));
browser = await chromium.launch();
});

after(async () => {
await browser?.close();
await new Promise((resolve) => server.close(resolve));
});
Comment thread
lowlydba marked this conversation as resolved.

function formatViolations(violations, label) {
if (violations.length === 0) return;
const detail = violations
.map((v) =>
`[${v.impact}] ${v.id}: ${v.description}\n` +
v.nodes.map((n) => ` • ${n.target}`).join('\n')
)
.join('\n\n');
assert.fail(`${violations.length} WCAG 2.2 AA violation(s) — ${label}:\n\n${detail}`);
}

async function runAxe(url) {
const context = await browser.newContext();
const page = await context.newPage();
try {
await page.goto(`${BASE_URL}${url}`, { waitUntil: 'domcontentloaded' });
await page.waitForSelector('main', { timeout: 10000 });
const { violations } = await new AxeBuilder({ page })
.withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa', 'wcag22aa'])
.analyze();
return violations;
} finally {
await context.close();
}
}

const PAGES = [
{ path: '/', label: 'homepage' },
{ path: '/docs/', label: 'docs index' },
];

for (const { path, label } of PAGES) {
test(`${label} passes WCAG 2.2 AA`, async () => {
formatViolations(await runAxe(path), label);
});
}
72 changes: 72 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"format": "prettier --write .",
"format:check": "prettier --check .",
"test": "vitest run",
"test:a11y": "node --test --test-reporter=spec __tests__/a11y.test.mjs",
"test:watch": "vitest",
"typecheck": "tsc --noEmit"
},
Expand All @@ -40,6 +41,7 @@
"react-dom": "^19.2.7"
},
"devDependencies": {
"@axe-core/playwright": "^4.11.3",
"@docusaurus/module-type-aliases": "^3.10.0",
"@docusaurus/types": "^3.10.0",
"@eslint/js": "^10.0.0",
Expand All @@ -52,6 +54,7 @@
"globals": "^17.6.0",
"jsdom": "^29.1.1",
"markdownlint-cli": "^0.48.0",
"playwright": "^1.61.0",
"prettier": "^3.8.4",
"typescript": "^6.0.3",
"vitest": "^4.1.8"
Expand Down
Loading