Skip to content

Commit 37ca236

Browse files
committed
CI: fail-fast on DAP port and JAR validation
- DAP wait loop now exits with error if port 10000 doesn't open - Added -f flag to curl for HTTP error detection - Added unzip -t validation to catch corrupt JAR downloads
1 parent 5bd31db commit 37ca236

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

.github/workflows/test-dap.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,19 @@ jobs:
213213
exit 1
214214
fi
215215
echo "Waiting for DAP on port 10000..."
216-
for i in {1..5}; do
216+
DAP_READY=false
217+
for i in {1..10}; do
217218
if nc -z localhost 10000 2>/dev/null; then
218219
echo "DAP ready after $i seconds"
220+
DAP_READY=true
219221
break
220222
fi
221223
sleep 1
222224
done
225+
if [ "$DAP_READY" != "true" ]; then
226+
echo "ERROR: DAP port 10000 not listening!"
227+
exit 1
228+
fi
223229
224230
- name: Cache Maven packages
225231
uses: actions/cache@v4
@@ -309,7 +315,12 @@ jobs:
309315
fi
310316
LUCEE_URL="https://cdn.lucee.org/$LUCEE_FILENAME"
311317
echo "Downloading Lucee from: $LUCEE_URL"
312-
curl -L -o lucee.jar "$LUCEE_URL"
318+
curl -L -f -o lucee.jar "$LUCEE_URL"
319+
# Validate JAR is not corrupt
320+
if ! unzip -t lucee.jar > /dev/null 2>&1; then
321+
echo "ERROR: Downloaded JAR is corrupt!"
322+
exit 1
323+
fi
313324
# Remove existing and copy new
314325
rm -f debuggee/lib/lucee-*.jar
315326
cp lucee.jar debuggee/lib/
@@ -381,13 +392,19 @@ jobs:
381392
exit 1
382393
fi
383394
echo "Waiting for DAP on port 10000..."
384-
for i in {1..5}; do
395+
DAP_READY=false
396+
for i in {1..10}; do
385397
if nc -z localhost 10000 2>/dev/null; then
386398
echo "DAP ready after $i seconds"
399+
DAP_READY=true
387400
break
388401
fi
389402
sleep 1
390403
done
404+
if [ "$DAP_READY" != "true" ]; then
405+
echo "ERROR: DAP port 10000 not listening!"
406+
exit 1
407+
fi
391408
392409
- name: Cache Maven packages
393410
uses: actions/cache@v4

0 commit comments

Comments
 (0)