File tree Expand file tree Collapse file tree 3 files changed +44
-0
lines changed
Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 8888 vuln-type : ' os,library'
8989 severity : ' CRITICAL,HIGH' # Only fail on Critical and High issues
9090
91+ # --- NEW STEP: Run Smoke Tests ---
92+ - name : Run Smoke Tests
93+ run : |
94+ docker run -d --name app -p 3000:3000 local-image-scan:latest
95+ sleep 15
96+ chmod +x ./scripts/smoke-test.sh
97+ ./scripts/smoke-test.sh http://localhost:3000
98+ docker stop app && docker rm app
99+
91100 - name : Log in to GHCR
92101 uses : docker/login-action@v3
93102 with :
Original file line number Diff line number Diff line change 1+ export async function GET ( ) {
2+ return Response . json ( {
3+ status : 'healthy' ,
4+ timestamp : new Date ( ) . toISOString ( )
5+ } )
6+ }
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Configuration
4+ SERVICE_URL=${1:- " http://localhost:3000" }
5+ MAX_RETRIES=30
6+ SLEEP_INTERVAL=3
7+
8+ echo " Starting smoke tests against $SERVICE_URL ..."
9+
10+ # Wait for frontend to be ready
11+ echo " Waiting for frontend to be up..."
12+ for (( i= 1 ; i<= MAX_RETRIES; i++ )) ; do
13+ response=$( curl -s -o /dev/null -w " %{http_code}" " $SERVICE_URL /api/health" )
14+ if [ " $response " == " 200" ]; then
15+ echo " ✅ Frontend is UP and healthy!"
16+
17+ # Print health details
18+ echo " Health endpoint response:"
19+ curl -s " $SERVICE_URL /api/health"
20+ echo " "
21+
22+ exit 0
23+ fi
24+ echo " Attempt $i /$MAX_RETRIES : Frontend not ready yet... waiting ${SLEEP_INTERVAL} s"
25+ sleep $SLEEP_INTERVAL
26+ done
27+
28+ echo " ❌ Frontend failed to start within timeout."
29+ exit 1
You can’t perform that action at this time.
0 commit comments