Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/actions/classify-bitcoin-core/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Classify Bitcoin Core version
description: Classify a Bitcoin Core matrix entry as a release tag or source ref.

inputs:
version:
description: Bitcoin Core release tag or repo@ref source entry.
required: true

outputs:
cache-key:
description: Artifact-safe cache key for the matrix entry.
value: ${{ steps.classify.outputs.cache-key }}
source:
description: Whether the matrix entry points to a source ref.
value: ${{ steps.classify.outputs.source }}
repo:
description: GitHub repository for source entries.
value: ${{ steps.classify.outputs.repo }}
ref:
description: Git ref for source entries.
value: ${{ steps.classify.outputs.ref }}

runs:
using: composite
steps:
- name: Classify Bitcoin Core version
id: classify
shell: bash
run: |
bitcoin_core_version="${{ inputs.version }}"
cache_key="${bitcoin_core_version//[^A-Za-z0-9_.-]/-}"
{
echo "cache-key=$cache_key"
if [[ "$bitcoin_core_version" == *@* ]]; then
echo "source=true"
echo "repo=${bitcoin_core_version%@*}"
echo "ref=${bitcoin_core_version#*@}"
else
echo "source=false"
fi
} >> "$GITHUB_OUTPUT"
46 changes: 46 additions & 0 deletions .github/actions/run-archived-nextest/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Run archived cargo-nextest profile
description: Install cargo-nextest, download the compiled archive, and run one profile.

inputs:
profile:
description: nextest profile to run.
required: true
github-token:
description: GitHub token used by cargo-binstall for release downloads.
required: true
bitcoin-core-version:
description: Bitcoin Core version selected by the matrix entry.
required: false
default: ""
bitcoin-core-binary:
description: Source-built Bitcoin Core binary path.
required: false
default: ""

runs:
using: composite
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@1.88

- name: Install cargo-nextest
uses: ./.github/actions/setup-nextest
with:
github-token: ${{ inputs.github-token }}

- name: Download compiled test archive
uses: actions/download-artifact@v8
with:
name: integration-test-binaries-${{ runner.os }}

- name: Run archived integration tests
shell: bash
env:
BITCOIN_CORE_VERSION: ${{ inputs.bitcoin-core-version }}
BITCOIN_CORE_BINARY: ${{ inputs.bitcoin-core-binary }}
run: |
RUST_BACKTRACE=1 RUST_LOG=debug cargo nextest run \
--profile "${{ inputs.profile }}" \
--archive-file "integration-test-binaries-${{ runner.os }}.tar.zst" \
--workspace-remap "${{ github.workspace }}/integration-tests" \
--nocapture
42 changes: 42 additions & 0 deletions .github/actions/setup-bitcoin-core-binary/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Setup Bitcoin Core binary
description: Download and prepare a source-built Bitcoin Core binary for tests.

inputs:
source:
description: Whether the current Bitcoin Core matrix entry is source-built.
required: true
cache-key:
description: Artifact-safe key for the Bitcoin Core source build.
required: true

runs:
using: composite
steps:
- name: Install Bitcoin Core runtime dependencies
if: inputs.source == 'true'
shell: bash
run: |
case "$RUNNER_OS" in
Linux)
sudo apt-get install -y libevent-dev libboost-dev libsqlite3-dev
;;
macOS)
brew install boost libevent sqlite
;;
*)
echo "Unsupported runner OS: $RUNNER_OS" >&2
exit 1
;;
esac

- name: Download Bitcoin Core binary
if: inputs.source == 'true'
uses: actions/download-artifact@v8
with:
name: bitcoin-core-${{ runner.os }}-${{ inputs.cache-key }}
path: bitcoin-core

- name: Prepare Bitcoin Core binary
if: inputs.source == 'true'
shell: bash
run: chmod +x bitcoin-core/bitcoin-node
38 changes: 38 additions & 0 deletions .github/actions/setup-bitcoin-integration-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Setup Bitcoin integration test runtime
description: Install IPC runtime dependencies and prepare a Bitcoin Core source binary when needed.

inputs:
bitcoin-core-version:
description: Bitcoin Core release tag or repo@ref source entry.
required: true

runs:
using: composite
steps:
- name: Install capnp dependencies
shell: bash
run: |
case "$RUNNER_OS" in
Linux)
sudo apt-get install -y capnproto libcapnp-dev
;;
macOS)
brew install capnp
;;
*)
echo "Unsupported runner OS: $RUNNER_OS" >&2
exit 1
;;
esac

- name: Classify Bitcoin Core version
id: bitcoin-core
uses: ./.github/actions/classify-bitcoin-core
with:
version: ${{ inputs.bitcoin-core-version }}

- name: Setup Bitcoin Core binary
uses: ./.github/actions/setup-bitcoin-core-binary
with:
source: ${{ steps.bitcoin-core.outputs.source }}
cache-key: ${{ steps.bitcoin-core.outputs.cache-key }}
21 changes: 21 additions & 0 deletions .github/actions/setup-nextest/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Setup cargo-nextest
description: Install cargo-nextest from upstream release artifacts.

inputs:
github-token:
description: GitHub token used by cargo-binstall for release downloads.
required: true

runs:
using: composite
steps:
- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@v1.20.0
with:
version: "1.20.0"

- name: Install cargo-nextest
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
run: cargo binstall --no-confirm --disable-telemetry --disable-strategies quick-install --locked cargo-nextest@0.9.100
Loading
Loading