Skip to content

Commit 9bfb76a

Browse files
committed
fix: resolve visual-diff workflow issues
- Remove duplicate Docker build command - Add proper container health checks and error handling - Improve service readiness verification with timeouts - Add container logs on failure for debugging
1 parent 28f0efc commit 9bfb76a

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

.github/workflows/visual-diff.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,34 @@ jobs:
7676
echo "Main JAR built successfully"
7777
docker build --build-arg argBasedVersion="${{ steps.extract-main-version.outputs.docker_version }}" -t wrongsecrets-main .
7878
echo "Main Docker image built successfully"
79-
docker build -t wrongsecrets-main .
8079
8180
- name: Start both versions
8281
run: |
8382
docker run -d -p 8080:8080 --name pr-version wrongsecrets-pr
8483
docker run -d -p 8081:8080 --name main-version wrongsecrets-main
84+
85+
# Wait for containers to start
86+
echo "Waiting for containers to start..."
8587
sleep 30
8688
89+
# Verify containers are running
90+
if ! docker ps --filter "name=pr-version" --filter "status=running" --quiet | grep -q .; then
91+
echo "PR version container failed to start"
92+
docker logs pr-version
93+
exit 1
94+
fi
95+
96+
if ! docker ps --filter "name=main-version" --filter "status=running" --quiet | grep -q .; then
97+
echo "Main version container failed to start"
98+
docker logs main-version
99+
exit 1
100+
fi
101+
102+
# Wait for services to be ready
103+
echo "Waiting for services to be ready..."
104+
timeout 60 bash -c 'until curl -f http://localhost:8080/actuator/health 2>/dev/null; do sleep 2; done' || echo "PR version health check failed"
105+
timeout 60 bash -c 'until curl -f http://localhost:8081/actuator/health 2>/dev/null; do sleep 2; done' || echo "Main version health check failed"
106+
87107
- name: Setup Node.js
88108
uses: actions/setup-node@v4
89109
with:

0 commit comments

Comments
 (0)