-
Notifications
You must be signed in to change notification settings - Fork 130
54 lines (42 loc) · 1.79 KB
/
python.yml
File metadata and controls
54 lines (42 loc) · 1.79 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
name: CI Checks - Python Tests
on: [push, pull_request]
jobs:
check-python:
runs-on: ubuntu-latest
env:
LDK_NODE_PYTHON_DIR: bindings/python
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Generate Python bindings
run: ./scripts/uniffi_bindgen_generate_python.sh
- name: Start bitcoind and electrs
run: docker compose up -d
- name: Wait for services to be fully initialized
run: |
echo "Waiting for Bitcoin to be ready..."
timeout 60 bash -c 'until docker exec ldk-node-bitcoin-1 bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass getblockchaininfo > /dev/null 2>&1; do echo "Waiting for Bitcoin..."; sleep 3; done'
echo "Bitcoin is ready"
echo "Waiting for Esplora to be ready..."
# Try to get Esplora's status with retries and a timeout
timeout 90 bash -c 'until curl -s http://127.0.0.1:3002/blocks/tip/hash > /dev/null 2>&1; do echo "Waiting for Esplora..."; sleep 3; done'
echo "Esplora is ready"
# This is critical - give Esplora extra time to fully index after it starts accepting connections
echo "Giving Esplora extra time to finish indexing..."
sleep 10
- name: Install testing prerequisites
run: |
pip3 install requests
- name: Run Python unit tests
env:
BITCOIN_CLI_BIN: "docker exec ldk-node-bitcoin-1 bitcoin-cli"
BITCOIND_RPC_USER: "user"
BITCOIND_RPC_PASSWORD: "pass"
ESPLORA_ENDPOINT: "http://127.0.0.1:3002"
run: |
cd $LDK_NODE_PYTHON_DIR
python3 -m unittest discover -s src/ldk_node