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