11name : e2e-tests-hybrid
22
3- # on:
4- # workflow_dispatch:
5- # pull_request:
3+ on :
4+ workflow_dispatch :
5+ pull_request :
66
77env :
88 TERM : xterm-256color
@@ -13,12 +13,12 @@ concurrency:
1313 cancel-in-progress : true
1414
1515jobs :
16- # Job 1: Run regtest infrastructure on Ubuntu
16+ # Job 1: Run regtest infrastructure on Ubuntu with tunneling
1717 regtest-infrastructure :
1818 runs-on : ubuntu-latest
1919 outputs :
20- electrum-url : ${{ steps.setup-regtest .outputs.electrum- url }}
21- lnd-url : ${{ steps.setup-regtest .outputs.lnd- url }}
20+ electrum-url : ${{ steps.tunnel-electrum .outputs.url }}
21+ lnd-url : ${{ steps.tunnel-lnd .outputs.url }}
2222
2323 steps :
2424 - name : Clone E2E tests
@@ -71,11 +71,19 @@ jobs:
7171 echo "Admin macaroon found! Setting permissions..."
7272 chmod -R 777 lnd
7373
74- # Get the runner's public IP (this will be accessible from other runners)
75- PUBLIC_IP=$(curl -s https://api.ipify.org)
76- echo "electrum-url=$PUBLIC_IP:60001" >> $GITHUB_OUTPUT
77- echo "lnd-url=$PUBLIC_IP:9735" >> $GITHUB_OUTPUT
78- echo "Regtest infrastructure ready at $PUBLIC_IP"
74+ echo "Regtest infrastructure ready locally"
75+
76+ - name : Expose Electrum with Cloudflare Tunnel
77+ id : tunnel-electrum
78+ uses : cloudflare/cloudflared-action@v2
79+ with :
80+ port : 60001
81+
82+ - name : Expose LND with Cloudflare Tunnel
83+ id : tunnel-lnd
84+ uses : cloudflare/cloudflared-action@v2
85+ with :
86+ port : 9735
7987
8088 - name : Keep regtest running
8189 run : |
@@ -117,6 +125,11 @@ jobs:
117125 # Show Docker containers
118126 echo "Docker containers:"
119127 docker ps
128+
129+ # Show tunnel URLs
130+ echo "Tunnel URLs:"
131+ echo "Electrum: ${{ steps.tunnel-electrum.outputs.url }}"
132+ echo "LND: ${{ steps.tunnel-lnd.outputs.url }}"
120133
121134 # Job 2: Build iOS app and run E2E tests on macOS
122135 e2e-tests :
@@ -338,6 +351,10 @@ jobs:
338351 echo "Updated UDID in capabilities:"
339352 grep -A 5 -B 5 "appium:udid" wdio.conf.ts
340353
354+ # Verify the bundle ID was updated
355+ echo "Updated bundle ID in capabilities:"
356+ grep -A 5 -B 5 "appium:bundleId" wdio.conf.ts
357+
341358 # Don't manually launch the app - let Appium handle it
342359 # Just ensure simulator is ready and app is installed
343360 echo "Ensuring simulator is ready..."
@@ -392,69 +409,49 @@ jobs:
392409 exit 1
393410 fi
394411
395- # Test electrum server connectivity
412+ echo "✅ Using Cloudflare Tunnel URLs for regtest connectivity"
413+
414+ # Test electrum server connectivity via tunnel
396415 if [ -n "$E2E_ELECTRUM_SERVER" ]; then
397- ELECTRUM_HOST=$(echo "$E2E_ELECTRUM_SERVER" | cut -d: -f1)
398- ELECTRUM_PORT=$(echo "$E2E_ELECTRUM_SERVER" | cut -d: -f2)
399- echo "Testing electrum server at $ELECTRUM_HOST:$ELECTRUM_PORT..."
400-
401- # Try multiple connection methods
402- echo "Testing with nc (netcat)..."
403- if nc -z "$ELECTRUM_HOST" "$ELECTRUM_PORT" 2>/dev/null; then
404- echo "✅ Electrum server is reachable via nc"
405- else
406- echo "❌ Electrum server is not reachable via nc"
407- fi
408-
409- echo "Testing with telnet..."
410- if timeout 5 telnet "$ELECTRUM_HOST" "$ELECTRUM_PORT" 2>/dev/null | grep -q "Connected"; then
411- echo "✅ Electrum server is reachable via telnet"
412- else
413- echo "❌ Electrum server is not reachable via telnet"
414- fi
416+ echo "Testing electrum server at $E2E_ELECTRUM_SERVER..."
415417
418+ # Test with curl (tunnel URLs are HTTPS)
416419 echo "Testing with curl..."
417- if curl -s --connect-timeout 5 "http://$ELECTRUM_HOST:$ELECTRUM_PORT " >/dev/null 2>&1; then
418- echo "✅ Electrum server is reachable via curl "
420+ if curl -s --connect-timeout 10 "$E2E_ELECTRUM_SERVER " >/dev/null 2>&1; then
421+ echo "✅ Electrum server is reachable via tunnel "
419422 else
420- echo "❌ Electrum server is not reachable via curl "
423+ echo "❌ Electrum server is not reachable via tunnel "
421424 fi
422425 fi
423426
424- # Test LND connectivity
427+ # Test LND connectivity via tunnel
425428 if [ -n "$E2E_LND_URL" ]; then
426- LND_HOST=$(echo "$E2E_LND_URL" | cut -d: -f1)
427- LND_PORT=$(echo "$E2E_LND_URL" | cut -d: -f2)
428- echo "Testing LND at $LND_HOST:$LND_PORT..."
429- if nc -z "$LND_HOST" "$LND_PORT" 2>/dev/null; then
430- echo "✅ LND is reachable"
429+ echo "Testing LND at $E2E_LND_URL..."
430+ if curl -s --connect-timeout 10 "$E2E_LND_URL" >/dev/null 2>&1; then
431+ echo "✅ LND is reachable via tunnel"
431432 else
432- echo "❌ LND is not reachable"
433+ echo "❌ LND is not reachable via tunnel "
433434 echo "This will cause tests to fail. Check if the regtest infrastructure job is still running."
434435 fi
435436 fi
436437
437438 # Check if we should continue with tests despite connectivity issues
438439 if [ -n "$E2E_ELECTRUM_SERVER" ] && [ -n "$E2E_LND_URL" ]; then
439- ELECTRUM_HOST=$(echo "$E2E_ELECTRUM_SERVER" | cut -d: -f1)
440- ELECTRUM_PORT=$(echo "$E2E_ELECTRUM_SERVER" | cut -d: -f2)
441- LND_HOST=$(echo "$E2E_LND_URL" | cut -d: -f1)
442- LND_PORT=$(echo "$E2E_LND_URL" | cut -d: -f2)
443-
444- if ! nc -z "$ELECTRUM_HOST" "$ELECTRUM_PORT" 2>/dev/null || ! nc -z "$LND_HOST" "$LND_PORT" 2>/dev/null; then
445- echo "⚠️ WARNING: Regtest services are not reachable. Tests will likely fail."
440+ if ! curl -s --connect-timeout 5 "$E2E_ELECTRUM_SERVER" >/dev/null 2>&1 || ! curl -s --connect-timeout 5 "$E2E_LND_URL" >/dev/null 2>&1; then
441+ echo "⚠️ WARNING: Regtest services are not reachable via tunnel. Tests will likely fail."
446442 echo "This could be due to:"
447443 echo "1. The regtest infrastructure job has stopped"
448- echo "2. Network connectivity issues between runners "
449- echo "3. Firewall blocking the connections "
444+ echo "2. Cloudflare tunnel issues"
445+ echo "3. Network connectivity issues "
450446 echo ""
451447 echo "🔧 SOLUTIONS TO TRY:"
452448 echo "1. Check if the regtest-infrastructure job is still running"
453- echo "2. Use a different regtest service (e.g., Blockstream's regtest API)"
454- echo "3. Run regtest on the same macOS runner (if Docker works)"
455- echo "4. Use a cloud-hosted regtest service"
449+ echo "2. Check Cloudflare tunnel logs"
450+ echo "3. Use a different regtest service (e.g., Blockstream's regtest API)"
456451 echo ""
457452 echo "Continuing with tests anyway..."
453+ else
454+ echo "✅ Regtest services are reachable via Cloudflare tunnels"
458455 fi
459456 fi
460457
0 commit comments