mirror of
https://github.com/Matysh/houseplan-card
synced 2026-07-31 08:28:31 +00:00
T1: demo/serve.mjs exports check/checkAll/finish — all 48 smokes now assert named facts and exit non-zero on a mismatch or an uncaught in-card exception (verified by breaking the kiosk guard on purpose). Informational values were frozen from a v1.43.1 run and cross-read against the source; timings assert budgets, not exact numbers. T2: new CI job 'smoke' gated on 'frontend', builds a FRESH bundle before running (the committed demo/srv/assets copy is a snapshot) and uploads per-file logs on failure. T3: [auto] now means 'a named failing check exists' and each line names it (43 lines); 72 aspirational markers honestly downgraded to [manual]. Fixed the 'ZERO edit buttons' contradiction (wrong since v1.30.1) and the opening-click line (true again since v1.43.1). Three smokes carried pre-v1.39.0/v1.25 expectations and were testing old behaviour: tap defaults for lights, card-wide tap action, label drag requiring plan mode. DEVELOPMENT.md documents the harness contract.
84 lines
2.6 KiB
YAML
84 lines
2.6 KiB
YAML
name: Validate
|
|
on:
|
|
push:
|
|
pull_request:
|
|
schedule:
|
|
- cron: "0 4 * * 1"
|
|
jobs:
|
|
hacs:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: HACS validation
|
|
uses: hacs/action@main
|
|
with:
|
|
category: integration
|
|
hassfest:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Hassfest validation
|
|
uses: home-assistant/actions/hassfest@master
|
|
frontend:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with: { node-version: 22 }
|
|
- run: npm ci
|
|
- name: Typecheck
|
|
run: npm run typecheck
|
|
- name: Unit tests
|
|
run: npm test
|
|
- name: Build
|
|
run: npm run build
|
|
- name: Card bundle in sync with integration
|
|
run: cmp dist/houseplan-card.js custom_components/houseplan/frontend/houseplan-card.js
|
|
smoke:
|
|
# audit T2: the end-to-end layer used to run only when a human remembered.
|
|
# Gated on `frontend` so a typecheck failure does not burn browser minutes.
|
|
needs: frontend
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with: { node-version: 22 }
|
|
- run: npm ci
|
|
- name: Install Chromium for Playwright
|
|
run: npx playwright install --with-deps chromium
|
|
- name: Build a FRESH bundle for the smokes
|
|
# the committed demo/srv/assets copy is a snapshot; testing it would
|
|
# report green about code that no longer exists (audit T2)
|
|
run: npm run build && cp dist/houseplan-card.js demo/srv/assets/houseplan-card.js
|
|
- name: Smoke suite
|
|
run: |
|
|
fail=0
|
|
mkdir -p /tmp/smoke-logs
|
|
for f in demo/smoke_*.mjs; do
|
|
name=$(basename "$f" .mjs)
|
|
if node "$f" > "/tmp/smoke-logs/$name.log" 2>&1; then
|
|
echo "ok $name"
|
|
else
|
|
echo "FAIL $name"
|
|
tail -20 "/tmp/smoke-logs/$name.log"
|
|
fail=1
|
|
fi
|
|
done
|
|
exit $fail
|
|
- name: Upload smoke logs
|
|
if: failure()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: smoke-logs
|
|
path: /tmp/smoke-logs
|
|
|
|
backend:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with: { python-version: "3.13" }
|
|
- run: pip install pytest voluptuous pytest-homeassistant-custom-component home-assistant-frontend
|
|
- name: Backend unit tests (pure + HA harness)
|
|
run: python -m pytest tests_backend/ -q
|