Skip to content

Commit fe5fc67

Browse files
committed
Add health check for backend service in CI workflow
1 parent e96b960 commit fe5fc67

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/ci_week7.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@ jobs:
3232
done
3333
working-directory: week7
3434

35+
- name: 💤 Wait for backend to become healthy
36+
run: |
37+
timeout=30
38+
for i in $(seq 1 $timeout); do
39+
status=$(docker inspect --format='{{.State.Health.Status}}' $(docker compose ps -q backend))
40+
echo "Backend health: $status"
41+
[ "$status" = "healthy" ] && break
42+
sleep 1
43+
done
44+
working-directory: week7
45+
3546
- name: 🧪 Test API endpoints
3647
run: |
3748
curl --fail http://localhost:3000/health

0 commit comments

Comments
 (0)