From ebdd4734cfd97bdac50789c0bcc7fa1281693cf4 Mon Sep 17 00:00:00 2001 From: Clawdbot Date: Thu, 12 Mar 2026 17:28:21 +1100 Subject: [PATCH] ci: add GitHub Actions workflow for ruff, pytest, and JS validation Runs on push/PR to main/master: - ruff F821 (undefined names) - py_compile (syntax check all .py) - pytest (if tests/ exists, continue-on-error) - node --check (inline JS in static/*.html) Co-Authored-By: Claude Opus 4.6 --- .github/workflows/ci.yml | 98 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..12cc961 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,98 @@ +# Standard CI workflow for Rod's VPS apps +# Copy to .github/workflows/ci.yml in each repo +# +# What it checks: +# 1. ruff F821 — undefined Python names (matches pre-commit hook) +# 2. py_compile — syntax validation on all .py files +# 3. pytest — runs tests/ if present (gracefully handles missing VPS-only deps) +# 4. JS validation — node --check on inline ', html, re.DOTALL) + for i, s in enumerate(scripts): + if s.strip(): + with open(f'/tmp/check_{i}.js', 'w') as out: + out.write(s) + " || true + for js in /tmp/check_*.js; do + [ -f "$js" ] || continue + if ! node --check "$js" 2>&1; then + echo "❌ JS error in $f" + ERRORS=$((ERRORS + 1)) + fi + rm -f "$js" + done + done + [ "$ERRORS" -eq 0 ] || exit 1