Files
admin-panel/.woodpecker.yml
T

49 lines
2.2 KiB
YAML

# Woodpecker CI pipeline for the admin panel — THIN on purpose.
#
# Runs the panel's EXISTING checks, unchanged:
# tests/test_guest_guard.py server-side duplicate-guest guard (pure, stdlib only)
# tests/check-page-js.sh + harnesses the page JS checker (node --check on the real
# <script> block, then stub + page JS + harness
# in ONE node scope) against every harness:
# admin-panel-chart-harness.js admin-panel-guests-harness.js
# admin-panel-invite-harness.js tests/money-chart-harness.js
#
# tests/check-page-js.sh is vendored byte-identically from the steward's skill
# script (the CI agent container has no host filesystem) — keep the two in step;
# its md5 is recorded in ops-docs so drift is detectable.
#
# Gating: `push` fires on every push (including branch pushes) so a red run
# blocks the merge via Gitea branch protection (status check
# `ci/woodpecker/push/main`). `manual` kept for hand-triggered runs.
#
# Backend note (why there are no container images here):
# The agent is a Cloudron app with no Docker socket → Woodpecker `local`
# backend: each step is a shell command INSIDE the agent container and the
# step's `image:` field selects the SHELL. python3 + node + bash are baked
# into the agent image (co-op/woodpecker-agent). Nothing to install at run
# time — the guest-guard test and the checker are stdlib-only by design.
when:
- event: push
- event: manual
steps:
- name: tests
image: bash
commands:
- python3 tests/test_guest_guard.py
# Run every harness even when one fails, then fail the step — a plain
# command chain would hide all failures after the first.
- |
fails=0
for h in admin-panel-chart-harness.js admin-panel-guests-harness.js \
admin-panel-invite-harness.js tests/money-chart-harness.js; do
echo "== harness: $h"
bash tests/check-page-js.sh app/main.py "$h" || fails=$((fails+1))
done
if [ "$fails" -ne 0 ]; then
echo "FAILED: $fails harness run(s) red"
exit 1
fi
echo "all admin-panel checks green"