-
Notifications
You must be signed in to change notification settings - Fork 157
100 lines (91 loc) · 4.21 KB
/
Copy path0fc-integration.yml
File metadata and controls
100 lines (91 loc) · 4.21 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: CI Checks - 0FC Integration Tests
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-test:
timeout-minutes: 60
runs-on: self-hosted
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Install Rust stable toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain stable
- name: Enable caching for bitcoind
id: cache-bitcoind
uses: actions/cache@v4
with:
path: bin/bitcoind-${{ runner.os }}-${{ runner.arch }}
key: bitcoind-29.0-${{ runner.os }}-${{ runner.arch }}
- name: Enable caching for electrs
id: cache-electrs
uses: actions/cache@v4
with:
path: bin/electrs-${{ runner.os }}-${{ runner.arch }}
key: electrs-submit-package-${{ runner.os }}-${{ runner.arch }}
- name: Download bitcoind
if: "steps.cache-bitcoind.outputs.cache-hit != 'true'"
run: |
source ./scripts/download_bitcoind_electrs.sh
mkdir -p bin
mv "$BITCOIND_EXE" bin/bitcoind-${{ runner.os }}-${{ runner.arch }}
- name: Download electrs
if: "steps.cache-electrs.outputs.cache-hit != 'true'"
run: |
source ./scripts/build_electrs.sh
mkdir -p bin
mv "$ELECTRS_EXE" bin/electrs-${{ runner.os }}-${{ runner.arch }}
- name: Set bitcoind/electrs environment variables
run: |
echo "BITCOIND_EXE=$( pwd )/bin/bitcoind-${{ runner.os }}-${{ runner.arch }}" >> "$GITHUB_ENV"
echo "ELECTRS_EXE=$( pwd )/bin/electrs-${{ runner.os }}-${{ runner.arch }}" >> "$GITHUB_ENV"
- name: Test with 0FC enabled
run: |
RUSTFLAGS="--cfg no_download --cfg cycle_tests --cfg tokio_unstable --cfg zero_fee_commitment_tests" cargo test -- --test-threads=1
eclair-interop-test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Start bitcoind and electrs
run: docker compose -p ldk-node -f tests/docker/docker-compose-eclair.yml up -d bitcoin electrs
- name: Wait for bitcoind to be healthy
run: |
for i in $(seq 1 30); do
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
echo "bitcoind is ready"
exit 0
fi
echo "Waiting for bitcoind... ($i/30)"
sleep 2
done
echo "ERROR: bitcoind not ready"
exit 1
- name: Create wallets on bitcoind
run: |
docker compose -p ldk-node -f tests/docker/docker-compose-eclair.yml exec bitcoin bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass createwallet eclair
docker compose -p ldk-node -f tests/docker/docker-compose-eclair.yml exec bitcoin bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass -rpcwallet=eclair getnewaddress
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
- name: Start Eclair with 0FC enabled
env:
ECLAIR_EXTRA_JAVA_OPTS: "-Declair.features.zero_fee_commitments=optional"
run: docker compose -p ldk-node -f tests/docker/docker-compose-eclair.yml up -d eclair
- name: Wait for Eclair to be ready
run: |
for i in $(seq 1 60); do
if curl -sf -u :eclairpassword -X POST http://127.0.0.1:8080/getinfo > /dev/null 2>&1; then
echo "Eclair is ready"
exit 0
fi
echo "Waiting for Eclair... ($i/60)"
sleep 5
done
echo "Eclair failed to start"
docker compose -p ldk-node -f tests/docker/docker-compose-eclair.yml logs eclair
exit 1
- name: Run Eclair 0FC integration tests
run: |
RUSTFLAGS="--cfg eclair_test --cfg zero_fee_commitment_tests" cargo test --test integration_tests_eclair -- --show-output --test-threads=1