Deploy Dev Stack / deploy (push) Successful in 55s
Deploy Dev Stack / pytest-backend (push) Successful in 50s
Deploy Dev Stack / lint-backend (push) Successful in 0s
Deploy Dev Stack / build-frontend (push) Successful in 17s
Deploy Dev Stack / k6 /health Baseline (push) Successful in 32s
Deploy Dev Stack / playwright-tests (push) Failing after 7m48s
workflow_run uses the workflow file on main and fell through to the prod directory when the triggering name was missing. Dev checks now follow Deploy Dev Stack and target the dev stack explicitly. Co-authored-by: Cursor <cursoragent@cursor.com>
132 lines
4.4 KiB
YAML
132 lines
4.4 KiB
YAML
# Name bewusst nicht "Deploy Development": die Test-Suite auf main lauscht auf
|
|
# diesen alten Namen und fällt ohne erkannten Workflow-Namen auf das Prod-Verzeichnis.
|
|
name: Deploy Dev Stack
|
|
|
|
on:
|
|
push:
|
|
branches: [develop]
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Deploy to Development
|
|
run: |
|
|
set -e
|
|
echo "=== Deploying Shinkan to DEVELOPMENT ==="
|
|
cd /home/lars/docker/shinkan-dev
|
|
git fetch origin develop || git clone http://192.168.2.144:3000/Lars/shinkan-jinkendo.git .
|
|
git reset --hard origin/develop
|
|
docker compose -f docker-compose.dev-env.yml build --no-cache
|
|
docker compose -f docker-compose.dev-env.yml up -d
|
|
sleep 5
|
|
if ! curl -sf http://localhost:8098/api/version; then
|
|
echo "✗ DEV API nicht erreichbar — Backend-Logs (Migration/Startup):"
|
|
docker compose -f docker-compose.dev-env.yml logs backend --tail 120 || true
|
|
exit 1
|
|
fi
|
|
echo "✓ DEV API healthy"
|
|
curl -sf http://localhost:3098/api/version && echo "✓ DEV über Frontend-Nginx (wie Browser) healthy"
|
|
echo "=== Shinkan DEV Deploy complete ==="
|
|
|
|
pytest-backend:
|
|
needs: deploy
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Backend pytest im Dev-Container
|
|
run: sh /home/lars/docker/shinkan-dev/scripts/ci/run-deployed-checks.sh dev pytest
|
|
|
|
lint-backend:
|
|
needs: deploy
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check backend syntax
|
|
run: sh /home/lars/docker/shinkan-dev/scripts/ci/run-deployed-checks.sh dev lint
|
|
|
|
build-frontend:
|
|
needs: deploy
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Build frontend
|
|
run: sh /home/lars/docker/shinkan-dev/scripts/ci/run-deployed-checks.sh dev frontend
|
|
|
|
k6-health-baseline:
|
|
name: k6 /health Baseline
|
|
needs: deploy
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: k6 gegen Dev
|
|
run: sh /home/lars/docker/shinkan-dev/scripts/ci/run-deployed-checks.sh dev k6
|
|
|
|
playwright-tests:
|
|
needs: deploy
|
|
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: Dev /health
|
|
run: |
|
|
BASE="https://dev.shinkan.jinkendo.de"
|
|
echo "Warte auf $BASE/health …"
|
|
for i in $(seq 1 90); do
|
|
if curl -sf "$BASE/health" >/dev/null 2>&1; then
|
|
echo "Health OK (Versuch $i)"
|
|
exit 0
|
|
fi
|
|
sleep 2
|
|
done
|
|
echo "Timeout: Dev /health nicht erreichbar"
|
|
curl -v "$BASE/health" || true
|
|
exit 1
|
|
|
|
- name: Testnutzer registrieren
|
|
env:
|
|
E2E_DEV_TEST_EMAIL: ${{ secrets.E2E_DEV_TEST_EMAIL }}
|
|
E2E_DEV_TEST_PASSWORD: ${{ secrets.E2E_DEV_TEST_PASSWORD }}
|
|
run: |
|
|
BASE="https://dev.shinkan.jinkendo.de"
|
|
if [ -z "$E2E_DEV_TEST_EMAIL" ] || [ -z "$E2E_DEV_TEST_PASSWORD" ]; then
|
|
echo "(Registrierung übersprungen — Secrets E2E_DEV_* nicht gesetzt.)"
|
|
exit 0
|
|
fi
|
|
curl -sf -X POST "$BASE/api/auth/register" \
|
|
-H "Content-Type: application/json" \
|
|
-d "{\"email\":\"${E2E_DEV_TEST_EMAIL}\",\"password\":\"${E2E_DEV_TEST_PASSWORD}\",\"name\":\"Playwright CI\"}" \
|
|
|| echo "(Register evtl. schon erfolgt oder Limits — Login-Test gilt trotzdem.)"
|
|
|
|
- name: Install Playwright
|
|
run: |
|
|
npm ci || npm install
|
|
npx playwright install --with-deps chromium
|
|
|
|
- name: Run Playwright tests
|
|
env:
|
|
E2E_DEV_TEST_EMAIL: ${{ secrets.E2E_DEV_TEST_EMAIL }}
|
|
E2E_DEV_TEST_PASSWORD: ${{ secrets.E2E_DEV_TEST_PASSWORD }}
|
|
PLAYWRIGHT_BASE_URL: https://dev.shinkan.jinkendo.de
|
|
run: |
|
|
set -e
|
|
export TEST_EMAIL="$E2E_DEV_TEST_EMAIL"
|
|
export TEST_PASSWORD="$E2E_DEV_TEST_PASSWORD"
|
|
if [ -z "$TEST_EMAIL" ] || [ -z "$TEST_PASSWORD" ]; then
|
|
echo "Fehler: E2E_DEV_TEST_EMAIL und E2E_DEV_TEST_PASSWORD setzen."
|
|
exit 1
|
|
fi
|
|
mkdir -p screenshots
|
|
npx playwright test
|
|
echo "Playwright tests passed"
|
|
|
|
- name: Upload test screenshots
|
|
if: failure()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: playwright-screenshots
|
|
path: screenshots/
|
|
retention-days: 7
|