name: Test Suite # Bei Push auf develop/main: nur schnelle Checks (Lint + Frontend-Build). # Vollständige Tests (pytest, k6, Playwright) laufen im Deploy-Workflow # deploy-dev.yml / deploy-prod.yml — Gitea/act unterstützt workflow_run oft nicht. on: push: branches: [develop, main] pull_request: branches: [develop] jobs: compose-smoke: if: github.event_name == 'pull_request' runs-on: ubuntu-latest env: COMPOSE_PROJECT_NAME: kairo-ci-smoke DB_PASSWORD: ci_smoke_password KAIRO_BACKEND_PORT: 18197 KAIRO_FRONTEND_PORT: 13197 steps: - name: Checkout repository uses: actions/checkout@v4 - name: Compose Stack bauen und testen (isolierte CI-Ports) run: | set -e COMPOSE="docker-compose.dev-env.yml" API_PORT="${KAIRO_BACKEND_PORT}" UI_PORT="${KAIRO_FRONTEND_PORT}" echo "=== Smoke: $COMPOSE (Projekt $COMPOSE_PROJECT_NAME, API $API_PORT) ===" docker compose -f "$COMPOSE" up -d --build --wait curl -sf "http://localhost:${API_PORT}/api/health" echo "✓ Backend /api/health OK" curl -sf "http://localhost:${UI_PORT}/api/health" echo "✓ Frontend-Proxy /api/health OK" docker compose -f "$COMPOSE" exec -T backend pip install -q -r requirements-dev.txt docker compose -f "$COMPOSE" exec -T backend python -m pytest tests -ra -vv --tb=short echo "✓ pytest OK" docker compose -f "$COMPOSE" down -v lint-backend: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Check backend syntax run: | python3 -m py_compile backend/main.py backend/run_migrations.py backend/db.py echo "✓ Backend syntax OK" build-frontend: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: "20" - name: Build frontend run: | cd frontend npm install npm run build echo "✓ Frontend build OK"