Files
cs249r_book/.github/scripts
Vijay Janapa Reddi f4f69c8a53 feat(ci): visual smoke gate before tinytorch dev deploy
Adds a Playwright-based smoke check that runs after the Quarto build
and before the dev preview deploy. Catches the four classes of
regression we just fixed in commit 6fdf81dd4:

  • <link rel=stylesheet> 404s (broken site_libs/ deploy)
  • JS console errors during page load
  • Blank-page renders (homepage body shorter than 1.5× viewport)
  • Navbar collapse breakpoint drift across the shared chrome (asserts
    expanded at 1200/1400, collapsed at 992/1199 in light + dark)

Layout follows the publish-guard pattern already in use:

  .github/scripts/visual_smoke.py        — test logic, runnable locally
                                           against any Quarto _build/ tree
  .github/workflows/infra-visual-smoke.yml
                                         — workflow_call reusable that
                                           runs the script on an uploaded
                                           build artifact

tinytorch-preview-dev.yml is split into three jobs:
  1. build-site  — builds Quarto, injects PDFs, uploads _build/ artifact
  2. smoke       — `uses:` the reusable; deploy is gated on this passing
  3. deploy      — downloads the same artifact (so we ship the exact
                   bytes smoke validated) and SSH-pushes to the dev repo

Verified locally:
  • script passes 8/8 (4 viewports × 2 schemes) on the fixed dev tip
  • script catches the regression: with collapse-below reverted to "lg"
    and re-rendered, smoke fails 4/8 with [NAVBAR_COLLAPSE_AT_XL] at
    exactly 992 + 1199 px in light + dark — the same widths a human
    would notice the wrap

Other sites' preview-dev workflows are intentionally untouched. Once
this proof-of-concept settles, copying the build-site/smoke/deploy
split to labs/kits/mlsysim/site/etc. is mechanical (the reusable
workflow doesn't change). A follow-up infra-visual-cross-site.yml
will run nightly across every site in a matrix and add the cross-site
consistency assertions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 18:13:03 -04:00
..