Follow-ups to #660 #19
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 - 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 |