Ampel-Vorlage v3: set +e (Runner-bash -e schnitt das Urteil ab)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+7
-4
@@ -17,7 +17,10 @@ jobs:
|
||||
- name: Ampel — erkennt Projekt-Typ selbst und prüft entsprechend
|
||||
shell: bash
|
||||
run: |
|
||||
set -uo pipefail
|
||||
# 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.
|
||||
# (Lehre Lauf #5: ungeschütztes pytest unter -e schnitt den Bericht ab.)
|
||||
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/*')
|
||||
@@ -29,8 +32,8 @@ jobs:
|
||||
|
||||
if [ -n "$py_datei" ]; then
|
||||
echo "== Python erkannt =="
|
||||
python3 -m venv /tmp/ampel-venv && . /tmp/ampel-venv/bin/activate
|
||||
pip install -q ruff pytest
|
||||
{ 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)"
|
||||
@@ -41,7 +44,7 @@ jobs:
|
||||
echo "-- Importierbar? (kaputte Modul-Struktur fliegt hier auf)"
|
||||
python -m compileall -q . || rot=1
|
||||
echo "-- Pytest (keine Tests gefunden = ROT)"
|
||||
pytest -q; ec=$?
|
||||
ec=0; pytest -q || ec=$?
|
||||
if [ $ec -eq 5 ]; then
|
||||
echo "❌ KEINE TESTS GEFUNDEN — Tests sind Pflicht, kein Deko (AGENTS.md)."
|
||||
rot=1
|
||||
|
||||
Reference in New Issue
Block a user