name: Core E2E Tests # The regtest stack (Bitcoin Core + Fulcrum + mempool/esplora + arkd + emulator) # is provided by the `regtest` git submodule (arkade-regtest) and driven by its # zero-dependency Node CLI (`regtest.mjs`). arkd runs from a container image # (ARKD_IMAGE in .env.regtest); the orchestrator self-funds it on `start`. on: workflow_call: env: CARGO_INCREMENTAL: 0 CARGO_TERM_COLOR: always jobs: build-tests: runs-on: ubuntu-latest outputs: test-binaries: ${{ steps.find-binaries.outputs.binaries }} steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: dtolnay/rust-toolchain@master with: toolchain: stable - uses: Swatinem/rust-cache@v2 with: prefix-key: "e2e_tests" - name: Build test binaries run: cargo test -p e2e-tests --no-run - name: Find test binaries id: find-binaries run: | BINARIES=$(find target/debug/deps -type f -executable -name "e2e_*" | jq -R -s -c 'split("\n")[:-1]') echo "binaries=$BINARIES" >> $GITHUB_OUTPUT echo "Found test binaries: $BINARIES" - name: Upload test binaries uses: actions/upload-artifact@v4 with: name: test-binaries path: target/debug/deps/e2e_* retention-days: 1 overwrite: true run-tests: needs: build-tests runs-on: ubuntu-latest strategy: fail-fast: false matrix: test-binary: ${{ fromJson(needs.build-tests.outputs.test-binaries) }} steps: - uses: actions/checkout@v4 with: fetch-depth: 0 submodules: recursive - name: Set up Node uses: actions/setup-node@v4 with: node-version: '20' - name: Download test binaries uses: actions/download-artifact@v4 with: name: test-binaries path: target/debug/deps - name: Show downloaded binaries run: ls -la target/debug/deps/ - name: Make binaries executable run: chmod +x target/debug/deps/e2e_* # Brings up base + ark (arkd) + emulator. The orchestrator waits for the # stack to be ready and self-funds arkd before returning. - name: Start regtest stack run: node regtest/regtest.mjs start --env .env.regtest --profile emulator - name: Run Test Binary env: INTROSPECTOR_URL: http://127.0.0.1:7073 REGTEST_DIR: ${{ github.workspace }}/regtest TEST_BINARY: ${{ matrix.test-binary }} run: | test_name=$(basename "$TEST_BINARY") echo "Running test: $test_name" "$TEST_BINARY" --ignored --test-threads=1 --nocapture - name: Print container logs on failure if: failure() run: | echo "=== block height ===" node regtest/regtest.mjs rpc getblockcount 2>&1 || echo "(getblockcount failed)" echo "=== auto-miner ticks ===" docker logs bitcoin-miner 2>&1 | tail -40 || echo "(bitcoin-miner not found)" for c in bitcoin fulcrum mempool_web nbxplorer arkd arkd-wallet emulator; do echo "=== docker logs $c ===" docker logs "$c" 2>&1 || echo "(container $c not found)" echo "=== end $c ===" done - name: Cleanup regtest stack if: always() run: node regtest/regtest.mjs clean || true