From a47cb3ade438940e7aeabd9f140c2ee0dcce8c75 Mon Sep 17 00:00:00 2001 From: leehk Date: Thu, 17 Apr 2025 21:36:19 +0800 Subject: [PATCH] check health --- .github/workflows/template_test.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/template_test.yml b/.github/workflows/template_test.yml index c19f87c..0140c2c 100644 --- a/.github/workflows/template_test.yml +++ b/.github/workflows/template_test.yml @@ -144,6 +144,18 @@ jobs: echo "Compose logs after wait:" docker compose -f "${{ steps.create_compose.outputs.COMPOSE_FILE_PATH }}" logs + - name: Check Docker Services Health + run: | + echo "Checking health of Docker services..." + # Check if all services are healthy + docker compose -f "${{ steps.create_compose.outputs.COMPOSE_FILE_PATH }}" ps --filter "status=running" --filter "health=healthy" | grep -q 'healthy' + if [ $? -ne 0 ]; then + echo "Error: One or more services are not healthy." + exit 1 + fi + echo "All services are healthy." + docker compose ps + - name: Run Tests shell: bash run: |