@@ -131,81 +131,3 @@ jobs:
131131 - name : Tear down the stack
132132 if : always()
133133 run : docker compose down
134-
135-
136- quick-start-stack :
137- name : Test quick-start stack
138- needs : wait-for-containers-build
139- runs-on : ubuntu-latest
140- steps :
141- - name : Checkout
142- uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
143-
144- - name : Create .env file for default settings
145- run : |
146- cp .env.example .env
147- sed -i 's/DOMAIN=.*/DOMAIN=ci-example.com/' .env
148-
149- - name : Create stack
150- uses : hoverkraft-tech/compose-action@4894d2492015c1774ee5a13a95b1072093087ec3 # v2.5.0
151- with :
152- compose-file : " ./docker-compose-quick-start.yml"
153- up-flags : " -d --quiet-pull"
154-
155- - name : Check readiness
156- run : |
157- has_healthcheck() {
158- local container=$1
159- local health_status=$(docker inspect --format='{{if .Config.Healthcheck}}true{{else}}false{{end}}' "$container")
160- [ "$health_status" = "true" ]
161- }
162-
163- check_containers() {
164- containers=$(docker compose ps -q)
165- for container in $containers; do
166- container_name=$(docker inspect --format '{{.Name}}' "$container" | sed 's/\///')
167- container_ip=$(docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$container")
168-
169- if has_healthcheck "$container"; then
170- echo "Container has healthcheck defined"
171- status=$(docker inspect --format "{{.State.Health.Status}}" "$container")
172- if [ "$status" != "healthy" ]; then
173- echo "❌ Container $container_name is not healthy (status: $status)"
174- return 1
175- fi
176- else
177- running=$(docker inspect --format "{{.State.Running}}" "$container")
178- if [ "$running" != "true" ]; then
179- echo "❌ Container $container_name is not running"
180- return 1
181- fi
182- fi
183-
184- echo "✅ Container $container_name is ready"
185- done
186- return 0
187- }
188-
189- # Wait for containers with timeout
190- TIMEOUT=300 # 5 minutes timeout
191- ELAPSED=0
192- SLEEP_TIME=10
193-
194- until check_containers; do
195- if [ $ELAPSED -ge $TIMEOUT ]; then
196- echo "❌ Timeout waiting for containers to be ready"
197- docker compose ps
198- docker compose logs
199- exit 1
200- fi
201- echo "⏳ Waiting for containers... ($ELAPSED seconds elapsed)"
202- sleep $SLEEP_TIME
203- ELAPSED=$((ELAPSED + SLEEP_TIME))
204- done
205-
206- echo "✅ All containers are ready!"
207- docker compose ps
208-
209- - name : Tear down the stack
210- if : always()
211- run : docker compose down
0 commit comments