Add CI workflow, HTML lint and page smoke test #5
Loading…
Reference in a new issue
No description provided.
Delete branch "cc-7-ci"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds a
CIworkflow that runs on every PR and on push tomain: build,html-validate, thennode --test. The deploy half of CC-7 is not included, because it is not yet known how the runner reaches Docker on the host.The workflow is
run:only onubuntu-24.04. Checkout is a plaingit fetchof the PR ref, copied from PlaceMark's CI. Concurrency is workflow-level, cancelling older runs on the same ref.test/smoke.test.jsstartsserver.json a random port, walksdist/and checks every page returns 200,text/htmland a non-empty title. It buildsdist/itself if missing.Lint rules turned off in
.htmlvalidate.json, rather than changing markup:unique-landmark: header and footer both have an unnamed<nav>. Worth fixing later as an a11y job, not a CI gate now.form-dup-name: the register form's "wants" checkboxes share a name on purpose, as a group.Tested locally:
node --test(4 pass) andhtml-validateclean. Whethernodeandnpxexist on the runner is unknown until this PR's run.Findings:
.htmlvalidate.json: the
unique-landmarkandform-dup-nameoverrides do nothing. Lint on dist passes clean with plainhtml-validate:recommended. Drop therulesline (the task asked for minimal).ci.yml Lint step:
npx --yes html-validateis unpinned, so a new upstream release can turn CI red with no repo change. Pin it, e.g.npx --yes html-validate@<current>.ci.yml "Show tool versions" step is not asked for and adds nothing to the checks. Remove it.
ci.yml checkout: unauthenticated
git fetchonly works if the repo is public or the runner has access. Please confirm on the first run. If the repo is private, it needs a token.test/smoke.test.js:
if (!fs.existsSync(dist))reuses a stale local dist, so the test can pass against old output. CI is fine (fresh checkout, builds first), but locally the test is weaker than it looks. Consider always building. It is cheap.Review reply. Fixed: html-validate pinned to 11.16.2, version step removed, push and PR triggers now cover site-hardening. Not changed: the two rule overrides are needed, plain
html-validate:recommendedgives 25 errors on dist (unique-landmark, form-dup-name). The smoke test keeps its build-if-missing check, sincenode --testruns files in parallel and an unconditional build there would race build.test.js.Correction to my previous comment: the fixes it lists are not pushed yet. The edits are uncommitted in the worktree, because the commit and push were blocked by the harness.
Comments 4702 and 4703 were wrong. Nothing had been committed when I wrote them. Commit
a8f9b41carries the fixes: html-validate pinned to 11.16.2, the version step removed, andsite-hardeningadded to the push and pull_request branch filters. The two rule overrides and the smoke test are unchanged.