Fix: add electrs health check to prevent CI race conditions #1674
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 services to be ready..." | |
| timeout 90 bash -c 'until docker compose ps | grep -q "bitcoin.*healthy" && docker compose ps | grep -q "electrs.*healthy"; do sleep 5; done' | |
| echo "All services are healthy" | |
| - 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 |