-
Notifications
You must be signed in to change notification settings - Fork 247
Expand file tree
/
Copy pathaction.yml
More file actions
56 lines (47 loc) · 1.62 KB
/
action.yml
File metadata and controls
56 lines (47 loc) · 1.62 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
name: "Setup Solana Validator"
description: "Start Solana test validator with health check"
inputs:
rpc-url:
description: "Solana RPC URL"
required: false
default: "http://127.0.0.1:8899"
timeout:
description: "Timeout in seconds to wait for validator"
required: false
default: "60"
outputs:
rpc-url:
description: "Solana RPC URL"
value: ${{ inputs.rpc-url }}
runs:
using: "composite"
steps:
- name: Start Solana test validator
shell: bash
run: |
echo "🚀 Starting Solana test validator..."
# Start validator with transfer hook program loaded
solana-test-validator --reset --quiet \
--bpf-program Bcdikjss8HWzKEuj6gEQoFq9TCnGnk6v3kUnRU1gb6hA tests/src/common/transfer-hook-example/transfer_hook_example.so &
VALIDATOR_PID=$!
echo "VALIDATOR_PID=$VALIDATOR_PID" >> $GITHUB_ENV
# Save PID to file for cleanup action
echo $VALIDATOR_PID > /tmp/validator_pid
# Wait for validator to be ready
echo "⏳ Waiting for validator to be ready..."
timeout=${{ inputs.timeout }}
counter=0
while [ $counter -lt $timeout ]; do
if solana cluster-version --url ${{ inputs.rpc-url }} >/dev/null 2>&1; then
echo "✅ Solana validator ready at ${{ inputs.rpc-url }}!"
break
fi
sleep 1
counter=$((counter + 1))
done
if [ $counter -eq $timeout ]; then
echo "❌ Solana validator timeout after $timeout seconds"
echo "Current processes:"
ps aux | grep solana || true
exit 1
fi