File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 7070 vuln-type : ' os,library'
7171 severity : ' CRITICAL,HIGH' # Only fail on Critical and High issues
7272
73+ # --- NEW STEP: Run Smoke Tests ---
74+ - name : Run Smoke Tests
75+ run : |
76+ docker run -d --name app -p 8080:8080 local-image-scan:latest
77+ sleep 5
78+ chmod +x ./scripts/smoke-test.sh
79+ ./scripts/smoke-test.sh http://localhost:8080
80+ docker stop app && docker rm app
81+
7382 - name : Log in to GHCR
7483 uses : docker/login-action@v3
7584 with :
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Configuration
4+ SERVICE_URL=${1:- " http://localhost:8080" }
5+ MAX_RETRIES=30
6+ SLEEP_INTERVAL=2
7+
8+ echo " Starting smoke tests against $SERVICE_URL ..."
9+
10+ # Wait for gateway to be ready
11+ echo " Waiting for gateway to be up..."
12+ for (( i= 1 ; i<= MAX_RETRIES; i++ )) ; do
13+ response=$( curl -s -o /dev/null -w " %{http_code}" " $SERVICE_URL /healthz" )
14+ if [ " $response " == " 200" ]; then
15+ echo " ✅ API Gateway is UP and healthy!"
16+ exit 0
17+ fi
18+ echo " Attempt $i /$MAX_RETRIES : Gateway not ready yet... waiting ${SLEEP_INTERVAL} s"
19+ sleep $SLEEP_INTERVAL
20+ done
21+
22+ echo " ❌ Gateway failed to start within timeout."
23+ exit 1
You can’t perform that action at this time.
0 commit comments