Run develop tests after the dev deploy, never against production by default.
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
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>
This commit is contained in:
1 parent
d4a193607f
commit
5fc839afbc
3 files changed
+268
-20
No files matched your search
+48
-19
@@ -1,15 +1,16 @@
|
||||
name: Test Suite
|
||||
|
||||
# develop: eine Suite, erst nach erfolgreichem Deploy Development (workflow_run).
|
||||
# Kein push-Trigger: der würde parallel zum Deploy ein zweites Mal starten
|
||||
# und gegen den noch alten oder gerade neu startenden Stack laufen.
|
||||
# pull_request: eine Suite vor dem Merge, gegen den zuletzt deployten Dev-Stand.
|
||||
# main: kein push/PR — Prod-Tests nur via workflow_run nach Deploy Production.
|
||||
# Dev-Tests hängen an "Deploy Dev Stack" (deploy-dev.yml) und laufen nach dem Deploy
|
||||
# gegen /home/lars/docker/shinkan-dev. Dieser Workflow hier startet sie nicht noch einmal.
|
||||
#
|
||||
# workflow_run läuft mit der Datei auf dem Standardbranch (main). Ein Dev-Deploy darf
|
||||
# hier nicht landen: ohne erkannten Namen fiel das Skript auf das Prod-Verzeichnis.
|
||||
# Produktion nur, wenn der auslösende Workflow exakt "Deploy Production" heißt.
|
||||
on:
|
||||
pull_request:
|
||||
branches: [develop]
|
||||
workflow_run:
|
||||
workflows: ["Deploy Development", "Deploy Production"]
|
||||
workflows: ["Deploy Production"]
|
||||
types: [completed]
|
||||
|
||||
jobs:
|
||||
@@ -25,18 +26,24 @@ jobs:
|
||||
REF_NAME="${{ github.ref_name }}"
|
||||
BASE_REF="${{ github.base_ref }}"
|
||||
RUN_WORKFLOW="${{ github.event.workflow_run.name }}"
|
||||
APP_DIR="/home/lars/docker/shinkan"
|
||||
COMPOSE_FILE="docker-compose.yml"
|
||||
HEAD_BRANCH="${{ github.event.workflow_run.head_branch }}"
|
||||
|
||||
if [ "$EVENT_NAME" = "workflow_run" ]; then
|
||||
if [ "$RUN_WORKFLOW" = "Deploy Development" ]; then
|
||||
APP_DIR="/home/lars/docker/shinkan-dev"
|
||||
COMPOSE_FILE="docker-compose.dev-env.yml"
|
||||
if [ "$RUN_WORKFLOW" != "Deploy Production" ]; then
|
||||
echo "workflow_run ist nicht Deploy Production (name=$RUN_WORKFLOW head=$HEAD_BRANCH ref=$REF_NAME)."
|
||||
echo "Produktion wird nicht angefasst."
|
||||
exit 1
|
||||
fi
|
||||
APP_DIR="/home/lars/docker/shinkan"
|
||||
COMPOSE_FILE="docker-compose.yml"
|
||||
elif [ "$REF_NAME" = "develop" ] || [ "$BASE_REF" = "develop" ]; then
|
||||
APP_DIR="/home/lars/docker/shinkan-dev"
|
||||
COMPOSE_FILE="docker-compose.dev-env.yml"
|
||||
else
|
||||
echo "Kein Dev-Ziel (event=$EVENT_NAME ref=$REF_NAME base=$BASE_REF). Abbruch."
|
||||
exit 1
|
||||
fi
|
||||
echo "CI-Ziel: $APP_DIR ($COMPOSE_FILE)"
|
||||
|
||||
cd "$APP_DIR"
|
||||
echo "Warte auf stabilen backend-Container …"
|
||||
@@ -70,16 +77,24 @@ jobs:
|
||||
run: |
|
||||
EVENT_NAME="${{ github.event_name }}"
|
||||
REF_NAME="${{ github.ref_name }}"
|
||||
BASE_REF="${{ github.base_ref }}"
|
||||
RUN_WORKFLOW="${{ github.event.workflow_run.name }}"
|
||||
APP_DIR="/home/lars/docker/shinkan"
|
||||
HEAD_BRANCH="${{ github.event.workflow_run.head_branch }}"
|
||||
|
||||
if [ "$EVENT_NAME" = "workflow_run" ]; then
|
||||
if [ "$RUN_WORKFLOW" = "Deploy Development" ]; then
|
||||
APP_DIR="/home/lars/docker/shinkan-dev"
|
||||
if [ "$RUN_WORKFLOW" != "Deploy Production" ]; then
|
||||
echo "workflow_run ist nicht Deploy Production (name=$RUN_WORKFLOW head=$HEAD_BRANCH ref=$REF_NAME)."
|
||||
echo "Produktion wird nicht angefasst."
|
||||
exit 1
|
||||
fi
|
||||
elif [ "$REF_NAME" = "develop" ]; then
|
||||
APP_DIR="/home/lars/docker/shinkan"
|
||||
elif [ "$REF_NAME" = "develop" ] || [ "$BASE_REF" = "develop" ]; then
|
||||
APP_DIR="/home/lars/docker/shinkan-dev"
|
||||
else
|
||||
echo "Kein Dev-Ziel (event=$EVENT_NAME ref=$REF_NAME base=$BASE_REF). Abbruch."
|
||||
exit 1
|
||||
fi
|
||||
echo "CI-Ziel: $APP_DIR"
|
||||
|
||||
python3 -m py_compile "$APP_DIR/backend/main.py"
|
||||
echo "✓ Backend syntax OK"
|
||||
@@ -92,16 +107,24 @@ jobs:
|
||||
run: |
|
||||
EVENT_NAME="${{ github.event_name }}"
|
||||
REF_NAME="${{ github.ref_name }}"
|
||||
BASE_REF="${{ github.base_ref }}"
|
||||
RUN_WORKFLOW="${{ github.event.workflow_run.name }}"
|
||||
APP_DIR="/home/lars/docker/shinkan"
|
||||
HEAD_BRANCH="${{ github.event.workflow_run.head_branch }}"
|
||||
|
||||
if [ "$EVENT_NAME" = "workflow_run" ]; then
|
||||
if [ "$RUN_WORKFLOW" = "Deploy Development" ]; then
|
||||
APP_DIR="/home/lars/docker/shinkan-dev"
|
||||
if [ "$RUN_WORKFLOW" != "Deploy Production" ]; then
|
||||
echo "workflow_run ist nicht Deploy Production (name=$RUN_WORKFLOW head=$HEAD_BRANCH ref=$REF_NAME)."
|
||||
echo "Produktion wird nicht angefasst."
|
||||
exit 1
|
||||
fi
|
||||
elif [ "$REF_NAME" = "develop" ]; then
|
||||
APP_DIR="/home/lars/docker/shinkan"
|
||||
elif [ "$REF_NAME" = "develop" ] || [ "$BASE_REF" = "develop" ]; then
|
||||
APP_DIR="/home/lars/docker/shinkan-dev"
|
||||
else
|
||||
echo "Kein Dev-Ziel (event=$EVENT_NAME ref=$REF_NAME base=$BASE_REF). Abbruch."
|
||||
exit 1
|
||||
fi
|
||||
echo "CI-Ziel: $APP_DIR"
|
||||
|
||||
cd "$APP_DIR/frontend"
|
||||
npm install
|
||||
@@ -129,6 +152,9 @@ jobs:
|
||||
echo "mode=prod" >> $GITHUB_OUTPUT
|
||||
echo "base_url=https://shinkan.jinkendo.de" >> $GITHUB_OUTPUT
|
||||
echo "→ k6 gegen Prod-Basis."
|
||||
elif [ "$EVENT" = "workflow_run" ]; then
|
||||
echo "workflow_run ist nicht Deploy Production (name=$WF_NAME). Abbruch."
|
||||
exit 1
|
||||
else
|
||||
echo "mode=dev" >> $GITHUB_OUTPUT
|
||||
echo "base_url=${DEV_BASE}" >> $GITHUB_OUTPUT
|
||||
@@ -219,6 +245,9 @@ jobs:
|
||||
echo "mode=prod" >> $GITHUB_OUTPUT
|
||||
echo "base_url=https://shinkan.jinkendo.de" >> $GITHUB_OUTPUT
|
||||
echo "→ Prod. Secrets: E2E_PROD_TEST_EMAIL / E2E_PROD_TEST_PASSWORD."
|
||||
elif [ "$EVENT" = "workflow_run" ]; then
|
||||
echo "workflow_run ist nicht Deploy Production (name=$WF_NAME). Abbruch."
|
||||
exit 1
|
||||
else
|
||||
echo "mode=dev" >> $GITHUB_OUTPUT
|
||||
echo "base_url=${DEV_BASE}" >> $GITHUB_OUTPUT
|
||||
|
||||
Reference in new issue
Block a user