furtka-apps/.forgejo/workflows/ci.yml
Daniel Maksymilian Syrnicki 3408e1aad8
All checks were successful
CI / validate (pull_request) Successful in 6s
CI / shellcheck (pull_request) Successful in 13s
feat: add mosquitto + zigbee2mqtt dependency pair
First catalog apps to exercise core 26.17's app-to-app dependency
feature — until now every app was standalone.

- mosquitto: MQTT broker, first dependency *provider*. Mandatory auth;
  per-consumer accounts created by on_install/on_start hooks
  (scripts/provision-client.sh, scripts/ensure-client.sh) that run inside
  the broker container via `docker compose exec`. Provider-side password
  stash so on_start can restore an account after a volume wipe.
- zigbee2mqtt: first dependency *consumer*. `requires` mosquitto; MQTT
  creds wired in from the provisioning hook via ZIGBEE2MQTT_CONFIG_* env.
  Serial coordinator path as a text setting + devices mapping.

Supporting changes:
- Bump vendored furtka_manifest.py (26.10-era -> 26.17) so the validator
  actually validates the `requires` schema instead of ignoring it.
- Document `requires`/hooks in apps/README.md (was undocumented), including
  the three framework gaps building this pair surfaced.
- CI now shellchecks app hook scripts (apps/*/scripts/*.sh), not just
  repo-root scripts/.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-28 23:45:27 +02:00

42 lines
1.1 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate JSON files
run: |
set -e
for f in $(find . -name '*.json' -not -path './node_modules/*'); do
echo "Validating $f"
python3 -m json.tool "$f" > /dev/null
done
- name: Validate apps/ (manifest schema + compose shape)
run: python3 scripts/validate-catalog.py
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install shellcheck
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends shellcheck
- name: Run shellcheck
run: |
set -e
shellcheck scripts/*.sh
# App dependency hooks (apps/*/scripts/*.sh) run inside provider
# containers — lint them too. The glob may match nothing, so guard it.
hooks=$(find apps -path 'apps/*/scripts/*.sh' 2>/dev/null || true)
if [ -n "$hooks" ]; then
echo "$hooks" | xargs shellcheck
fi