1414 uses : actions/checkout@v4
1515
1616 - name : Check and install CMake if needed
17- # lnd_grpc_rust (via prost-build v0.10.4) requires CMake >= 3.5 but is incompatible with CMake >= 4.0.
18- # This step checks if CMake is missing, below 3.5, or 4.0 or higher, and installs CMake 3.31.6 if needed,
19- # ensuring compatibility with prost-build in ubuntu-latest.
2017 run : |
2118 if ! command -v cmake &> /dev/null ||
2219 [ "$(cmake --version | head -n1 | cut -d' ' -f3)" \< "3.5" ] ||
@@ -33,24 +30,54 @@ jobs:
3330 fi
3431
3532 - name : Create temporary directory for LND data
36- id : create-temp-dir
3733 run : echo "LND_DATA_DIR=$(mktemp -d)" >> $GITHUB_ENV
3834
3935 - name : Start bitcoind, electrs, and LND
4036 run : docker compose -p ldk-node -f tests/docker/docker-compose-lnd.yml up -d
4137 env :
4238 LND_DATA_DIR : ${{ env.LND_DATA_DIR }}
4339
40+ - name : Wait for LND to be ready
41+ run : |
42+ for i in $(seq 1 30); do
43+ if docker exec ldk-node-lnd test -f /root/.lnd/data/chain/bitcoin/regtest/admin.macaroon 2>/dev/null; then
44+ echo "LND macaroon found"
45+ break
46+ fi
47+ echo "Waiting for LND macaroon... ($i/30)"
48+ sleep 2
49+ done
50+ docker exec ldk-node-lnd test -f /root/.lnd/data/chain/bitcoin/regtest/admin.macaroon || {
51+ echo "ERROR: LND macaroon not found after 60 seconds"
52+ docker compose -p ldk-node -f tests/docker/docker-compose-lnd.yml logs lnd
53+ exit 1
54+ }
55+
4456 - name : Set permissions for LND data directory
45- # In PR 4622 (https://github.com/lightningnetwork/lnd/pull/4622),
46- # LND sets file permissions to 0700, preventing test code from accessing them.
47- # This step ensures the test suite has the necessary permissions.
48- run : sudo chmod -R 755 $LND_DATA_DIR
57+ run : sudo chmod -R u+rwX,go+rX $LND_DATA_DIR
4958 env :
5059 LND_DATA_DIR : ${{ env.LND_DATA_DIR }}
5160
61+ - name : Wait for LND gRPC to be ready
62+ run : |
63+ for i in $(seq 1 15); do
64+ if docker exec ldk-node-lnd lncli \
65+ --rpcserver=localhost:8081 \
66+ --tlscertpath=/root/.lnd/tls.cert \
67+ --macaroonpath=/root/.lnd/data/chain/bitcoin/regtest/admin.macaroon \
68+ --network=regtest getinfo 2>/dev/null; then
69+ echo "LND gRPC is ready"
70+ exit 0
71+ fi
72+ echo "Waiting for LND gRPC... ($i/15)"
73+ sleep 2
74+ done
75+ echo "ERROR: LND gRPC not ready after 30 seconds"
76+ docker compose -p ldk-node -f tests/docker/docker-compose-lnd.yml logs lnd
77+ exit 1
78+
5279 - name : Run LND integration tests
5380 run : LND_CERT_PATH=$LND_DATA_DIR/tls.cert LND_MACAROON_PATH=$LND_DATA_DIR/data/chain/bitcoin/regtest/admin.macaroon
54- RUSTFLAGS="--cfg lnd_test" cargo test --test integration_tests_lnd -- --exact --show-output
81+ RUSTFLAGS="--cfg lnd_test" cargo test --test integration_tests_lnd -- --show-output --test-threads=1
5582 env :
5683 LND_DATA_DIR : ${{ env.LND_DATA_DIR }}
0 commit comments