@@ -13,18 +13,41 @@ jobs:
1313 - name : Checkout repository
1414 uses : actions/checkout@v4
1515
16- - name : Install dependencies
17- run : |
18- sudo apt-get update -y
19- sudo apt-get install -y socat
16+ - name : Create temporary directory for CLN data
17+ run : echo "CLN_DATA_DIR=$(mktemp -d)" >> $GITHUB_ENV
2018
2119 - name : Start bitcoind, electrs, and lightningd
22- run : docker compose -f docker-compose-cln.yml up -d
20+ run : docker compose -p ldk-node -f tests/docker/docker-compose-cln.yml up -d
21+ env :
22+ CLN_DATA_DIR : ${{ env.CLN_DATA_DIR }}
23+
24+ - name : Wait for CLN to be ready
25+ run : |
26+ for i in $(seq 1 30); do
27+ if docker exec ldk-node-cln-1 lightning-cli --regtest getinfo 2>/dev/null | grep -q '"id"'; then
28+ echo "CLN is ready"
29+ break
30+ fi
31+ echo "Waiting for CLN... ($i/30)"
32+ sleep 2
33+ done
34+ docker exec ldk-node-cln-1 lightning-cli --regtest getinfo || {
35+ echo "ERROR: CLN not responding"
36+ docker compose -p ldk-node -f tests/docker/docker-compose-cln.yml logs cln
37+ exit 1
38+ }
2339
24- - name : Forward lightningd RPC socket
40+ - name : Set permissions for CLN data directory
2541 run : |
26- docker exec ldk-node-cln-1 sh -c "socat -d -d TCP-LISTEN:9937,fork,reuseaddr UNIX-CONNECT:/root/.lightning/regtest/lightning-rpc&"
27- socat -d -d UNIX-LISTEN:/tmp/lightning-rpc,reuseaddr,fork TCP:127.0.0.1:9937&
42+ sudo chown -R $(id -u):$(id -g) $CLN_DATA_DIR
43+ sudo chmod 755 $CLN_DATA_DIR
44+ sudo find $CLN_DATA_DIR -type d -exec chmod 755 {} +
45+ sudo find $CLN_DATA_DIR -type f -exec chmod 644 {} +
46+ env :
47+ CLN_DATA_DIR : ${{ env.CLN_DATA_DIR }}
2848
2949 - name : Run CLN integration tests
30- run : RUSTFLAGS="--cfg cln_test" cargo test --test integration_tests_cln
50+ run : CLN_SOCKET_PATH=$CLN_DATA_DIR/regtest/lightning-rpc
51+ RUSTFLAGS="--cfg cln_test" cargo test --test integration_tests_cln -- --show-output --test-threads=1
52+ env :
53+ CLN_DATA_DIR : ${{ env.CLN_DATA_DIR }}
0 commit comments