|
| 1 | +name: CI Checks - Eclair Integration Tests |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +concurrency: |
| 6 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 7 | + cancel-in-progress: true |
| 8 | + |
| 9 | +jobs: |
| 10 | + check-eclair: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - name: Checkout repository |
| 14 | + uses: actions/checkout@v4 |
| 15 | + |
| 16 | + - name: Start bitcoind and electrs |
| 17 | + run: docker compose -p ldk-node -f tests/docker/docker-compose-eclair.yml up -d bitcoin electrs |
| 18 | + |
| 19 | + - name: Wait for bitcoind to be healthy |
| 20 | + run: | |
| 21 | + for i in $(seq 1 30); do |
| 22 | + if docker compose -p ldk-node -f tests/docker/docker-compose-eclair.yml exec bitcoin bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass getblockchaininfo > /dev/null 2>&1; then |
| 23 | + echo "bitcoind is ready" |
| 24 | + exit 0 |
| 25 | + fi |
| 26 | + echo "Waiting for bitcoind... ($i/30)" |
| 27 | + sleep 2 |
| 28 | + done |
| 29 | + echo "ERROR: bitcoind not ready" |
| 30 | + exit 1 |
| 31 | +
|
| 32 | + - name: Create wallets on bitcoind |
| 33 | + run: | |
| 34 | + docker compose -p ldk-node -f tests/docker/docker-compose-eclair.yml exec bitcoin bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass createwallet eclair |
| 35 | + docker compose -p ldk-node -f tests/docker/docker-compose-eclair.yml exec bitcoin bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass -rpcwallet=eclair getnewaddress |
| 36 | + docker compose -p ldk-node -f tests/docker/docker-compose-eclair.yml exec bitcoin bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass createwallet ldk_node_test |
| 37 | +
|
| 38 | + - name: Start Eclair |
| 39 | + run: docker compose -p ldk-node -f tests/docker/docker-compose-eclair.yml up -d eclair |
| 40 | + |
| 41 | + - name: Wait for Eclair to be ready |
| 42 | + run: | |
| 43 | + for i in $(seq 1 60); do |
| 44 | + if curl -sf -u :eclairpassword -X POST http://127.0.0.1:8080/getinfo > /dev/null 2>&1; then |
| 45 | + echo "Eclair is ready" |
| 46 | + exit 0 |
| 47 | + fi |
| 48 | + echo "Waiting for Eclair... ($i/60)" |
| 49 | + sleep 5 |
| 50 | + done |
| 51 | + echo "Eclair failed to start" |
| 52 | + docker compose -p ldk-node -f tests/docker/docker-compose-eclair.yml logs eclair |
| 53 | + exit 1 |
| 54 | +
|
| 55 | + - name: Run Eclair integration tests |
| 56 | + run: RUSTFLAGS="--cfg eclair_test" cargo test --test integration_tests_eclair -- --show-output --test-threads=1 |
0 commit comments