-
Notifications
You must be signed in to change notification settings - Fork 1
649 lines (585 loc) · 25.9 KB
/
main.yml
File metadata and controls
649 lines (585 loc) · 25.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
name: Java CI Combined
on:
push:
pull_request:
workflow_dispatch:
inputs:
deploy:
description: 'Deploy to Maven Central'
type: boolean
default: false
lucee-versions:
description: 'JSON array of Lucee version queries (e.g. ["6.2.5.34/snapshot/jar","6.2.6.0/snapshot/jar"])'
default: '["6.2/snapshot/jar","7.0/snapshot/jar"]'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
setup:
runs-on: ubuntu-latest
outputs:
lucee-matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Set Lucee test matrix
id: set-matrix
env:
INPUT_VERSIONS: ${{ inputs.lucee-versions }}
run: |
DEFAULT='["6.2/snapshot/jar","7.0/snapshot/jar"]'
MATRIX="${INPUT_VERSIONS:-$DEFAULT}"
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
# Build extension (.lex file)
build-extension:
name: Build extension
runs-on: ubuntu-latest
outputs:
version: ${{ steps.extract-version.outputs.VERSION }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up JDK 11
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '11'
- name: Cache Maven packages
uses: actions/cache@v5
with:
path: ~/.m2
key: maven-${{ hashFiles('**/pom.xml') }}
restore-keys: maven-
- name: Build extension with Maven
run: mvn -B -e clean install
- name: Extract version number
id: extract-version
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Write build summary
run: |
echo "## Build Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Property | Value |" >> $GITHUB_STEP_SUMMARY
echo "|----------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| Extension Version | \`${{ steps.extract-version.outputs.VERSION }}\` |" >> $GITHUB_STEP_SUMMARY
echo "| Artifact | \`websocket-extension-${{ steps.extract-version.outputs.VERSION }}.lex\` |" >> $GITHUB_STEP_SUMMARY
- name: Upload extension
uses: actions/upload-artifact@v7
with:
name: extension-lex
path: target/*.lex
retention-days: 1
# Test against multiple Lucee versions using Lucee Express
# - 6.2: javax servlet (Tomcat 9)
# - 7.0: jakarta servlet (Tomcat 11)
test:
name: Test - Lucee ${{ matrix.lucee }}
runs-on: ubuntu-latest
needs: [setup, build-extension]
env:
LUCEE_LOGGING_FORCE_APPENDER: console
LUCEE_LOGGING_FORCE_LEVEL: info
strategy:
fail-fast: false
matrix:
lucee: ${{ fromJSON(needs.setup.outputs.lucee-matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Determine Tomcat and Java version
id: config
run: |
MAJOR_MINOR=$(echo "${{ matrix.lucee }}" | grep -oE '^[0-9]+\.[0-9]+')
case "$MAJOR_MINOR" in
6.2)
echo "tomcat=tomcat-9" >> $GITHUB_OUTPUT
echo "java=11" >> $GITHUB_OUTPUT
;;
7.0|7.1)
echo "tomcat=tomcat-11" >> $GITHUB_OUTPUT
echo "java=21" >> $GITHUB_OUTPUT
;;
*)
echo "ERROR: Unknown Lucee major version: $MAJOR_MINOR"
exit 1
;;
esac
- name: Set up JDK ${{ steps.config.outputs.java }}
uses: actions/setup-java@v5
with:
java-version: '${{ steps.config.outputs.java }}'
distribution: 'temurin'
- name: Download extension
uses: actions/download-artifact@v8
with:
name: extension-lex
path: extension
- name: Download Lucee Express template
run: |
EXPRESS_URL=$(curl -s https://update.lucee.org/rest/update/provider/expressTemplates | jq -r '.["${{ steps.config.outputs.tomcat }}"]')
echo "Downloading Express template from: $EXPRESS_URL"
curl -L -o express-template.zip "$EXPRESS_URL"
unzip -q express-template.zip -d lucee-express
- name: Download Lucee JAR
id: lucee-jar
run: |
LUCEE_URL=$(curl -s "https://update.lucee.org/rest/update/provider/latest/${{ matrix.lucee }}/url" | tr -d '"')
if [ -z "$LUCEE_URL" ] || [[ "$LUCEE_URL" == *"error"* ]]; then
echo "ERROR: Could not get Lucee URL from update API for query: ${{ matrix.lucee }}"
exit 1
fi
LUCEE_FILENAME=$(basename "$LUCEE_URL")
LUCEE_VERSION=$(echo "$LUCEE_FILENAME" | sed 's/lucee-//;s/\.jar//')
echo "LUCEE_VERSION=$LUCEE_VERSION" >> $GITHUB_OUTPUT
echo "Downloading Lucee $LUCEE_VERSION from: $LUCEE_URL"
curl -L -f -o lucee.jar "$LUCEE_URL"
if ! unzip -t lucee.jar > /dev/null 2>&1; then
echo "ERROR: Downloaded JAR is corrupt!"
exit 1
fi
rm -f lucee-express/lib/lucee-*.jar
cp lucee.jar lucee-express/lib/
- name: Download websocket-client extension
run: |
echo "Downloading websocket-client extension..."
curl -L -o websocket-client.lex "https://ext.lucee.org/websocket-client-extension-2.3.0.9-SNAPSHOT.lex"
ls -la websocket-client.lex
- name: Install extensions into Express
run: |
mkdir -p lucee-express/lucee-server/deploy
cp extension/*.lex lucee-express/lucee-server/deploy/
cp websocket-client.lex lucee-express/lucee-server/deploy/
echo "Extensions to deploy:"
ls -la lucee-express/lucee-server/deploy/
- name: Copy test websocket listeners
run: |
# The websocket extension looks for listeners in {lucee-server}/websockets/.
# Collect listeners from every websockets/ subfolder under tests/ so both
# top-level (server-only) and tests/integration/ listeners get picked up.
mkdir -p lucee-express/lucee-server/context/websockets
find tests -path '*/websockets/*.cfc' -exec cp {} lucee-express/lucee-server/context/websockets/ \;
echo "WebSocket listeners:"
ls -la lucee-express/lucee-server/context/websockets/
- name: Copy tests to webroot
run: |
cp -r tests lucee-express/webapps/ROOT/
- name: Configure Tomcat port
run: |
sed -i 's/port="8080"/port="8888"/g' lucee-express/conf/server.xml
- name: Warmup Lucee Express
if: false # disabled to test cold-start without warmup masking race conditions
run: |
cd lucee-express
echo "Running Lucee warmup..."
export LUCEE_ENABLE_WARMUP=true
./bin/catalina.sh run
echo "Warmup complete"
- name: Start Lucee Express
run: |
cd lucee-express
echo "Starting Lucee Express..."
./bin/catalina.sh start
echo "Lucee Express started"
- name: Wait for server to be ready
run: |
echo "Waiting for HTTP on port 8888..."
for i in {1..60}; do
if curl -s -o /dev/null -w "%{http_code}" http://localhost:8888/ | grep -q "200\|302\|404"; then
echo "HTTP ready after $i seconds"
break
fi
sleep 1
done
- name: Debug Lucee config
if: always()
run: |
echo "=== lucee-server/context structure ==="
find lucee-express/lucee-server/context -type f -name "*.json" -o -name "*.cfc" 2>/dev/null | head -50
echo ""
echo "=== websocket.json (if exists) ==="
cat lucee-express/lucee-server/context/websocket.json 2>/dev/null || echo "Not found"
echo ""
echo "=== .CFConfig.json (if exists) ==="
cat lucee-express/lucee-server/context/.CFConfig.json 2>/dev/null || echo "Not found"
echo ""
echo "=== websockets directory ==="
ls -la lucee-express/lucee-server/context/websockets/ 2>/dev/null || echo "Not found"
- name: Test websocketInfo()
id: test-websocket-info
continue-on-error: true
run: |
echo "Testing websocketInfo() on Lucee ${{ matrix.lucee }}..."
RESPONSE=$(curl -s -w "\n%{http_code}" http://localhost:8888/tests/test-websocket-info.cfm)
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
BODY=$(echo "$RESPONSE" | sed '$d')
echo "$BODY"
# Save output for summary
echo "$BODY" > /tmp/test-websocket-info.txt
if [ "$HTTP_CODE" != "200" ] || echo "$BODY" | grep -q "FAILED"; then
echo "TEST_RESULT=❌ FAILED" >> $GITHUB_OUTPUT
echo "TEST_FAILED=true" >> $GITHUB_OUTPUT
else
echo "Test passed!"
echo "TEST_RESULT=✅ PASSED" >> $GITHUB_OUTPUT
fi
- name: Run integration tests
id: integration-tests
continue-on-error: true
run: |
echo "Running integration tests on Lucee ${{ matrix.lucee }}..."
FAILED=false
RESULTS=""
for test in test-websocket-client test-lifecycle-callbacks test-return-value-send test-wsclient-broadcast test-wsclients-plural test-binary-send test-close test-session-access test-onfirstopen-rearm test-onopen-async test-request-timeout; do
echo ""
echo "=============================================="
echo "Running ${test}"
echo "=============================================="
RESPONSE=$(curl -s -w "\n%{http_code}" http://localhost:8888/tests/integration/${test}.cfm)
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
BODY=$(echo "$RESPONSE" | sed '$d')
echo "$BODY"
echo "$BODY" > /tmp/${test}.txt
if [ "$HTTP_CODE" != "200" ] || echo "$BODY" | grep -q "FAILED"; then
echo "${test}: ❌ FAILED"
RESULTS="${RESULTS}${test}: ❌ FAILED\n"
FAILED=true
else
echo "${test}: ✅ PASSED"
RESULTS="${RESULTS}${test}: ✅ PASSED\n"
fi
done
echo -e "$RESULTS" > /tmp/integration-results.txt
if [ "$FAILED" = "true" ]; then
echo "INTEGRATION_FAILED=true" >> $GITHUB_OUTPUT
echo "INTEGRATION_RESULT=❌ Some tests failed" >> $GITHUB_OUTPUT
else
echo "INTEGRATION_RESULT=✅ All tests passed" >> $GITHUB_OUTPUT
fi
- name: Dump WebSocket event logs
if: always()
run: |
# Event logs are written to the system temp dir by file-based test listeners
# (see LifecycleListener.cfc). Dumped on always() so failing tests have
# visible debug info in the CI log.
echo "=== WebSocket Test Event Logs ==="
found=false
for f in /tmp/ws-*.log; do
[ -f "$f" ] || continue
found=true
echo ""
echo "--- $f ---"
cat "$f"
done
if [ "$found" = "false" ]; then
echo "(no event logs found — no test wrote to /tmp/ws-*.log)"
fi
- name: Test idleTimeout (LDEV-6219)
id: test-idle-timeout
continue-on-error: true
run: |
echo "Testing idleTimeout on Lucee ${{ matrix.lucee }}..."
RESPONSE=$(curl -s -w "\n%{http_code}" http://localhost:8888/tests/test-idle-timeout.cfm)
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
BODY=$(echo "$RESPONSE" | sed '$d')
echo "$BODY"
echo "$BODY" > /tmp/test-idle-timeout.txt
if [ "$HTTP_CODE" != "200" ] || echo "$BODY" | grep -q "FAILED"; then
echo "IDLE_TEST_RESULT=❌ FAILED" >> $GITHUB_OUTPUT
echo "IDLE_TEST_FAILED=true" >> $GITHUB_OUTPUT
else
echo "Test passed!"
echo "IDLE_TEST_RESULT=✅ PASSED" >> $GITHUB_OUTPUT
fi
- name: Write test summary
if: always()
run: |
echo "## Test Results - Lucee ${{ matrix.lucee }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Property | Value |" >> $GITHUB_STEP_SUMMARY
echo "|----------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| Lucee Version | \`${{ steps.lucee-jar.outputs.LUCEE_VERSION }}\` |" >> $GITHUB_STEP_SUMMARY
echo "| Tomcat | ${{ steps.config.outputs.tomcat }} |" >> $GITHUB_STEP_SUMMARY
echo "| Java | ${{ steps.config.outputs.java }} |" >> $GITHUB_STEP_SUMMARY
echo "| websocketInfo() | ${{ steps.test-websocket-info.outputs.TEST_RESULT || '⚠️ Unknown' }} |" >> $GITHUB_STEP_SUMMARY
echo "| Integration Tests | ${{ steps.integration-tests.outputs.INTEGRATION_RESULT || '⚠️ Unknown' }} |" >> $GITHUB_STEP_SUMMARY
echo "| idleTimeout (LDEV-6219) | ${{ steps.test-idle-timeout.outputs.IDLE_TEST_RESULT || '⚠️ Unknown' }} |" >> $GITHUB_STEP_SUMMARY
# Include failure details in summary
if [ "${{ steps.test-websocket-info.outputs.TEST_FAILED }}" = "true" ]; then
echo "" >> $GITHUB_STEP_SUMMARY
echo "### websocketInfo() Test Output" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat /tmp/test-websocket-info.txt >> $GITHUB_STEP_SUMMARY || true
echo '```' >> $GITHUB_STEP_SUMMARY
fi
if [ "${{ steps.integration-tests.outputs.INTEGRATION_FAILED }}" = "true" ]; then
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Integration Tests" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat /tmp/integration-results.txt >> $GITHUB_STEP_SUMMARY || true
echo '```' >> $GITHUB_STEP_SUMMARY
for test in test-websocket-client test-lifecycle-callbacks test-return-value-send test-wsclient-broadcast test-wsclients-plural test-binary-send test-close test-session-access test-onfirstopen-rearm test-onopen-async test-request-timeout; do
if [ -f /tmp/${test}.txt ] && grep -q "FAILED" /tmp/${test}.txt; then
echo "" >> $GITHUB_STEP_SUMMARY
echo "#### ${test}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat /tmp/${test}.txt >> $GITHUB_STEP_SUMMARY || true
echo '```' >> $GITHUB_STEP_SUMMARY
fi
done
fi
if [ "${{ steps.test-idle-timeout.outputs.IDLE_TEST_FAILED }}" = "true" ]; then
echo "" >> $GITHUB_STEP_SUMMARY
echo "### idleTimeout Test Output (LDEV-6219)" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat /tmp/test-idle-timeout.txt >> $GITHUB_STEP_SUMMARY || true
echo '```' >> $GITHUB_STEP_SUMMARY
fi
- name: Fail if tests failed
if: steps.test-websocket-info.outputs.TEST_FAILED == 'true' || steps.integration-tests.outputs.INTEGRATION_FAILED == 'true' || steps.test-idle-timeout.outputs.IDLE_TEST_FAILED == 'true'
run: exit 1
- name: Stop Lucee Express
if: always()
run: |
cd lucee-express
./bin/shutdown.sh || true
- name: Show catalina.out
if: always()
run: |
echo "=== catalina.out ==="
cat lucee-express/logs/catalina.out || echo "No catalina.out found"
- name: Upload logs
if: always()
uses: actions/upload-artifact@v7
with:
name: lucee-logs-${{ steps.lucee-jar.outputs.LUCEE_VERSION }}
path: |
lucee-express/logs/
lucee-express/lucee-server/context/logs/
test-config-override:
name: Test - Config override (${{ matrix.override-mode }})
runs-on: ubuntu-latest
needs: [build-extension]
strategy:
fail-fast: false
matrix:
include:
- override-mode: env-var
env-var-value: /tmp/ws-alt-config.json
java-opts: ""
- override-mode: jvm-arg
env-var-value: ""
java-opts: "-Dlucee.websocket.config=/tmp/ws-alt-config.json"
env:
LUCEE_LOGGING_FORCE_APPENDER: console
LUCEE_LOGGING_FORCE_LEVEL: info
LUCEE_WEBSOCKET_CONFIG: ${{ matrix.env-var-value }}
LUCEE_ADMIN_PASSWORD: testadmin
JAVA_OPTS: ${{ matrix.java-opts }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
- name: Download extension
uses: actions/download-artifact@v8
with:
name: extension-lex
path: extension
- name: Download Lucee Express template (tomcat-11)
run: |
EXPRESS_URL=$(curl -s https://update.lucee.org/rest/update/provider/expressTemplates | jq -r '.["tomcat-11"]')
curl -L -o express-template.zip "$EXPRESS_URL"
unzip -q express-template.zip -d lucee-express
- name: Download Lucee JAR (7.0 snapshot)
id: lucee-jar
run: |
LUCEE_URL=$(curl -s "https://update.lucee.org/rest/update/provider/latest/7.0/snapshot/jar/url" | tr -d '"')
LUCEE_VERSION=$(basename "$LUCEE_URL" | sed 's/lucee-//;s/\.jar//')
echo "LUCEE_VERSION=$LUCEE_VERSION" >> $GITHUB_OUTPUT
curl -L -f -o lucee.jar "$LUCEE_URL"
rm -f lucee-express/lib/lucee-*.jar
cp lucee.jar lucee-express/lib/
- name: Download websocket-client extension
run: curl -L -o websocket-client.lex "https://ext.lucee.org/websocket-client-extension-2.3.0.9-SNAPSHOT.lex"
- name: Install extensions into Express
run: |
mkdir -p lucee-express/lucee-server/deploy
cp extension/*.lex lucee-express/lucee-server/deploy/
cp websocket-client.lex lucee-express/lucee-server/deploy/
- name: Set up ALT config + listener path (no default listeners copied)
run: |
# Alt config file — the LUCEE_WEBSOCKET_CONFIG env var points the extension here
echo '{"directory":"/tmp/ws-alt-listeners/","requestTimeout":50,"idleTimeout":300}' > /tmp/ws-alt-config.json
# Alt listener directory — extension will look here (not in default {lucee-config}/websockets/)
mkdir -p /tmp/ws-alt-listeners
cp tests/websockets/TestListener.cfc /tmp/ws-alt-listeners/
echo "Alt config:"; cat /tmp/ws-alt-config.json
echo "Alt listeners:"; ls -la /tmp/ws-alt-listeners/
- name: Copy tests to webroot
run: cp -r tests lucee-express/webapps/ROOT/
- name: Configure Tomcat port
run: sed -i 's/port="8080"/port="8888"/g' lucee-express/conf/server.xml
- name: Resolve built .lex absolute path
run: |
LEX_FILE=$(ls $GITHUB_WORKSPACE/extension/*.lex | head -1)
echo "WS_EXT_LEX_PATH=$LEX_FILE" >> $GITHUB_ENV
echo "Resolved .lex to: $LEX_FILE"
- name: Start Lucee Express (override mode = ${{ matrix.override-mode }})
run: cd lucee-express && ./bin/catalina.sh start
- name: Wait for server
run: |
for i in {1..60}; do
if curl -s -o /dev/null -w "%{http_code}" http://localhost:8888/ | grep -q "200\|302\|404"; then
echo "HTTP ready after $i seconds"; break
fi
sleep 1
done
- name: Run config-override test
id: config-override-test
continue-on-error: true
run: |
RESPONSE=$(curl -s -w "\n%{http_code}" http://localhost:8888/tests/integration/test-config-override.cfm)
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
BODY=$(echo "$RESPONSE" | sed '$d')
echo "$BODY"
if [ "$HTTP_CODE" != "200" ] || echo "$BODY" | grep -q "FAILED"; then
echo "CONFIG_OVERRIDE_FAILED=true" >> $GITHUB_OUTPUT
fi
# ------------------------------------------------------------------
# Reflection / Lucee-restart scenario — TEMPORARILY DISABLED.
#
# The post-restart path hits a real bug: after cfadmin action="restart",
# the new CFMLEngine's extension classloader can't load
# JakartaWebSocketEndpoint.class — `WebSocketEndpointFactory.scanWebContexts`
# and `registerEndpoint` both fail with "unable to load class path".
# The reflection fallback never gets a chance to patch the old static slot
# because the new classes themselves aren't loadable.
#
# The test CFMs (trigger-lucee-restart.cfm, test-reflection-restart.cfm)
# and this workflow block are kept in place for when the underlying bug
# is fixed — just re-enable the steps below.
#
# See LDEV-6221 and the companion catalina.out output in the earlier CI
# run logs for the stack trace.
# ------------------------------------------------------------------
# - name: Trigger Lucee engine restart (LDEV-6221 scenario)
# id: restart-trigger
# continue-on-error: true
# run: |
# RESPONSE=$(curl -s -w "\n%{http_code}" http://localhost:8888/tests/integration/trigger-lucee-restart.cfm)
# HTTP_CODE=$(echo "$RESPONSE" | tail -1)
# BODY=$(echo "$RESPONSE" | sed '$d')
# echo "$BODY"
# if [ "$HTTP_CODE" != "200" ] || echo "$BODY" | grep -q "FAILED"; then
# echo "RESTART_TRIGGER_FAILED=true" >> $GITHUB_OUTPUT
# fi
#
# - name: Wait for Lucee to come back online
# run: |
# for i in {1..60}; do
# if curl -s -o /dev/null -w "%{http_code}" http://localhost:8888/tests/test-websocket-info.cfm | grep -q "200"; then
# echo "Lucee responding after $i attempts"
# break
# fi
# sleep 1
# done
#
# - name: Run post-restart reflection round-trip
# id: reflection-test
# continue-on-error: true
# run: |
# RESPONSE=$(curl -s -w "\n%{http_code}" http://localhost:8888/tests/integration/test-reflection-restart.cfm)
# HTTP_CODE=$(echo "$RESPONSE" | tail -1)
# BODY=$(echo "$RESPONSE" | sed '$d')
# echo "$BODY"
# if [ "$HTTP_CODE" != "200" ] || echo "$BODY" | grep -q "FAILED"; then
# echo "REFLECTION_FAILED=true" >> $GITHUB_OUTPUT
# fi
#
# - name: Verify reflection warning in catalina.out
# id: reflection-log-check
# continue-on-error: true
# run: |
# if grep -q "calling \[.*\] via reflection" lucee-express/logs/catalina.out; then
# echo "Reflection warning found — hot re-install exercised the fallback path"
# grep "calling \[.*\] via reflection" lucee-express/logs/catalina.out
# else
# echo "REFLECTION_LOG_MISSING=true" >> $GITHUB_OUTPUT
# echo "Reflection warning NOT found in catalina.out — hot re-install did not hit the fallback path"
# fi
- name: Dump WebSocket event logs
if: always()
run: |
for f in /tmp/ws-*.log; do
[ -f "$f" ] || continue
echo "--- $f ---"; cat "$f"
done || echo "(no event logs found)"
- name: Stop Lucee Express
if: always()
run: cd lucee-express && ./bin/shutdown.sh || true
- name: Show catalina.out
if: always()
run: cat lucee-express/logs/catalina.out || echo "No catalina.out found"
- name: Upload logs
if: always()
uses: actions/upload-artifact@v7
with:
name: lucee-logs-config-override-${{ matrix.override-mode }}-${{ steps.lucee-jar.outputs.LUCEE_VERSION }}
path: |
lucee-express/logs/
lucee-express/lucee-server/context/logs/
- name: Fail if any sub-test failed
if: steps.config-override-test.outputs.CONFIG_OVERRIDE_FAILED == 'true'
run: exit 1
deploy:
runs-on: ubuntu-latest
needs: [build-extension, test, test-config-override]
if: github.event_name == 'workflow_dispatch' && inputs.deploy && needs.test.result == 'success' && needs.test-config-override.result == 'success'
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up JDK 11
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '11'
- name: Cache Maven packages
uses: actions/cache@v5
with:
path: ~/.m2
key: maven-${{ hashFiles('**/pom.xml') }}
restore-keys: maven-
- name: Import GPG key
run: |
echo "$GPG_PRIVATE_KEY" | base64 --decode | gpg --batch --import
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Build and Deploy with Maven
id: deploy
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
if [[ "${{ needs.build-extension.outputs.version }}" == *-SNAPSHOT ]]; then
echo "------- Maven Deploy snapshot -------";
echo "DEPLOY_TYPE=Snapshot" >> $GITHUB_OUTPUT
mvn -B -e clean deploy --settings maven-settings.xml
else
echo "------- Maven Deploy release -------";
echo "DEPLOY_TYPE=Release" >> $GITHUB_OUTPUT
mvn -B -e clean deploy -DperformRelease=true --settings maven-settings.xml
fi
- name: Write deploy summary
if: success()
run: |
echo "## Deploy Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Property | Value |" >> $GITHUB_STEP_SUMMARY
echo "|----------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| Version | \`${{ needs.build-extension.outputs.version }}\` |" >> $GITHUB_STEP_SUMMARY
echo "| Type | ${{ steps.deploy.outputs.DEPLOY_TYPE }} |" >> $GITHUB_STEP_SUMMARY
echo "| Status | ✅ Published to Maven Central |" >> $GITHUB_STEP_SUMMARY