Skip to content

Commit 8c198be

Browse files
authored
Update examples.yml
Signed-off-by: SimiHunjan <simi.hunjan.k@gmail.com>
1 parent 78e483f commit 8c198be

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/examples.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,40 @@ jobs:
3939
echo "ECDSA Account: ${{ steps.solo.outputs.ecdsaAccountId }}"
4040
echo "ECDSA PrivateKey: **** (redacted)"
4141
42+
- name: Wait for Mirror Node health
43+
env:
44+
URL: ${{ env.MIRROR_NODE_URL }}
45+
run: |
46+
set -euo pipefail
47+
base="${URL%/}" # strip trailing slash
48+
root="${base%/api/v1}" # strip /api/v1 if present
49+
# Try both /api/v1/health and /health (some builds expose both)
50+
tries=60
51+
echo "Waiting for mirror health at: ${base}/health (or ${root}/health)"
52+
for i in $(seq 1 $tries); do
53+
if curl -fsS "${base}/health" >/dev/null 2>&1 || curl -fsS "${root}/health" >/dev/null 2>&1; then
54+
echo "✅ Mirror health OK"
55+
exit 0
56+
fi
57+
echo "⏳ Mirror not ready (try $i/${tries})…"
58+
sleep 2
59+
done
60+
echo "❌ Mirror never became healthy"
61+
curl -sv "${base}/health" || curl -sv "${root}/health" || true
62+
exit 1
63+
64+
- name: Sanity check mirror endpoints
65+
env:
66+
URL: ${{ env.MIRROR_NODE_URL }}
67+
run: |
68+
set -euo pipefail
69+
base="${URL%/}"
70+
echo "GET ${base}/network/nodes?limit=1"
71+
curl -fsS "${base}/network/nodes?limit=1" | jq -C . || true
72+
echo "GET ${base}/accounts?limit=1"
73+
curl -fsS "${base}/accounts?limit=1" | jq -C . || true
74+
75+
4276
- name: Set up JDK 21
4377
uses: actions/setup-java@v4
4478
with:

0 commit comments

Comments
 (0)