Files
rippy/.gitea/workflows/ci.yml
HitonabiandClaude Fable 5 a172a3e2c0
Ampel / ampel (push) Failing after 1m20s
fix(ci): setup-node raus — der Runner hat Node 24 nativ
Lauf 221 brach nach 2:14 min ab; der einzige neue Schritt war
actions/setup-node@v4. Nachgemessen am 30.08.2026: Das Runner-Image
docker.gitea.com/runner-images:ubuntu-latest bringt Node v24.18.0 und
npm 11.16 von Haus aus mit, und die kompletten Node-Schritte der Ampel
(npm ci + build + test in rippy-windows) laufen in einem frischen
node:24-Container auf der VM gruen durch. Statt Beschaffungs-Magie
prueft die Ampel jetzt im Klartext, dass Node >= 22 da ist — zu alt
heisst ROT mit Ansage, nicht kryptisch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-30 17:07:53 +02:00

95 lines
4.5 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Universelle CI-Ampel (Vorlage: mission-control-v2/deploy/ampel-ci.yml, 22.07.2026).
# GRUNDSATZ: Rot ist ein Ergebnis („nicht bewiesen"), kein Ärgernis.
# • Reines Doku-Repo (noch kein Code) → GRÜN mit Vermerk.
# • Code ohne Tests → ROT. Tests sind Pflicht, kein Deko.
# Der Workflow erkennt selbst, was das Projekt ist (Python / Node / beides).
name: Ampel
on: [push, pull_request]
jobs:
ampel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Ampel — erkennt Projekt-Typ selbst und prüft entsprechend
shell: bash
run: |
# Der Runner startet bash mit -e — das schalten wir ab: die Ampel wertet
# JEDEN Fehler selbst (rot=1) und liefert am Ende EIN Klartext-Urteil.
set -u +e
rot=0
py_datei=$(find . -name '*.py' -not -path './.git/*' -not -path '*/node_modules/*' -print -quit)
pkg_dateien=$(find . -name package.json -not -path '*/node_modules/*' -not -path './.git/*')
if [ -z "$py_datei" ] && [ -z "$pkg_dateien" ]; then
echo "✅ Doku-Repo (noch kein Code) — Ampel GRÜN mit Vermerk."
exit 0
fi
if [ -n "$py_datei" ]; then
echo "== Python erkannt =="
{ python3 -m venv /tmp/ampel-venv && . /tmp/ampel-venv/bin/activate; } || { echo "❌ Python-Setup kaputt (venv)"; exit 1; }
pip install -q ruff pytest || { echo "❌ Werkzeug-Installation kaputt"; exit 1; }
echo "-- Ruff (Linter: toter Code, kaputte Imports, Schlampereien)"
ruff check . || rot=1
echo "-- Abhängigkeiten installierbar? (halluzinierte Pakete fliegen hier auf)"
while IFS= read -r req; do
[ -n "$req" ] || continue
pip install -q -r "$req" || { echo "❌ $req nicht installierbar"; rot=1; }
done < <(find . -name 'requirements*.txt' -not -path '*/node_modules/*' -not -path './.git/*')
echo "-- Importierbar? (kaputte Modul-Struktur fliegt hier auf)"
python -m compileall -q . || rot=1
echo "-- Pytest (keine Tests gefunden = ROT)"
ec=0; pytest -q || ec=$?
if [ $ec -eq 5 ]; then
echo "❌ KEINE TESTS GEFUNDEN — Tests sind Pflicht, kein Deko (AGENTS.md)."
rot=1
elif [ $ec -ne 0 ]; then
rot=1
fi
fi
if [ -n "$pkg_dateien" ]; then
echo "== Node/TypeScript erkannt =="
# Rippy v5 (rippy-windows/) braucht Node >= 22 (node:sqlite, Vite 7).
# Das Runner-Image (docker.gitea.com/runner-images:ubuntu-latest)
# bringt Node 24 nativ mit — am 30.08.2026 nachgemessen. Ein
# actions/setup-node-Schritt scheiterte hier dagegen (Lauf 221);
# deshalb die Prüfung als Klartext statt Beschaffungs-Magie.
node_major=$(node -p 'parseInt(process.versions.node)' 2>/dev/null || echo 0)
echo "-- Node im Runner: $(node -v 2>/dev/null || echo 'FEHLT')"
if [ "$node_major" -lt 22 ]; then
echo "❌ Node zu alt für rippy-windows (braucht >= 22) — Runner-Image prüfen."
rot=1
fi
while IFS= read -r pkg; do
[ -n "$pkg" ] || continue
d=$(dirname "$pkg")
echo "-- $d"
if [ ! -f "$d/package-lock.json" ]; then
echo "❌ $d: kein package-lock.json — Build nicht reproduzierbar."
echo " Fix: dort 'npm install --package-lock-only' ausführen und committen."
rot=1; continue
fi
(cd "$d" && npm ci --no-audit --no-fund) || { rot=1; continue; }
if grep -q '"build"' "$pkg"; then (cd "$d" && npm run build) || rot=1; fi
if grep -q '"test"' "$pkg"; then (cd "$d" && npm test --silent) || rot=1; fi
done <<< "$pkg_dateien"
fi
if [ $rot -ne 0 ]; then
echo "❌ AMPEL ROT — nichts heißt fertig', solange das rot ist."
fi
exit $rot
- name: Ergebnis
if: success()
shell: bash
run: |
# Single Source of Truth: 'main' (24.07.2026, Commander-Entscheid —
# der stable-Zwischenbranch ist weg). Die Ampel PRÜFT nur noch und
# befördert nichts; deployt wird direkt aus 'main' (git pull auf der
# VM bzw. ./deploy.sh). Rot heißt weiterhin: nicht deployen.
echo "✅ AMPEL GRÜN. Deploy-Quelle ist 'main' — von dort deployen."