Skip to content

integration_test: Add explicit types everywhere #1901

integration_test: Add explicit types everywhere

integration_test: Add explicit types everywhere #1901

Workflow file for this run

--- # rust-bitcoin CI: If you edit this file please update README.md
on: # yamllint disable-line rule:truthy
push:
branches:
- master
- 'test-ci/**'
pull_request:
name: Continuous integration
jobs:
Test: # 6 jobs: 3 toolchains × 2 lock files.
name: Test - ${{ matrix.toolchain }} toolchain (${{ matrix.dep }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dep: [minimal, recent]
toolchain: [stable, nightly, msrv]
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0
- name: "Run ${{ matrix.toolchain }} tests"
run: |
cargo rbmt --lock-file ${{ matrix.dep }} test --toolchain ${{ matrix.toolchain }} \
-p bitreq \
-p corepc-client \
-p jsonrpc-fuzz \
-p jsonrpc \
-p corepc-types
Lint:
name: Lint - nightly toolchain
runs-on: ubuntu-latest
env:
BITCOIND_SKIP_DOWNLOAD: "1"
ELECTRSD_SKIP_DOWNLOAD: "1"
strategy:
fail-fast: false
matrix:
dep: [recent]
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0
- name: "Run lints"
run: |
cargo rbmt --lock-file ${{ matrix.dep }} lint \
-p bitreq \
-p corepc-client \
-p jsonrpc-fuzz \
-p jsonrpc \
-p corepc-types
./contrib/lint-integration-tests.sh
./contrib/lint-verify.sh
Docs:
name: Docs - stable toolchain
runs-on: ubuntu-latest
env:
BITCOIND_SKIP_DOWNLOAD: "1"
ELECTRSD_SKIP_DOWNLOAD: "1"
strategy:
fail-fast: false
matrix:
dep: [recent]
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0
- name: "Run doc tests"
run: cargo rbmt --lock-file ${{ matrix.dep }} docs
Docsrs:
name: Docs - nightly toolchain
runs-on: ubuntu-latest
env:
BITCOIND_SKIP_DOWNLOAD: "1"
ELECTRSD_SKIP_DOWNLOAD: "1"
strategy:
fail-fast: false
matrix:
dep: [recent]
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0
- name: "Run docsrs tests"
run: cargo rbmt --lock-file ${{ matrix.dep }} docsrs
Format: # 1 job, run cargo fmt directly.
name: Format - nightly toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0
- name: "Check formatting"
run: |
cargo rbmt fmt --check
./contrib/fmt-integration-tests.sh
./contrib/fmt-verify.sh
Verify: # 1 job, run `verify` directly.
name: Verify - stable toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@stable
- name: "Run the verify program"
# Verify all versions (known to the verify program)
run: cd verify && cargo run all
Integration: # 1 job for each bitcoind version we support.
name: Integration tests - stable toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
[
"31_0",
"30_2",
# No `30_0` or `30_1` because of wallet migration bug.
"29_0",
"28_2",
"27_2",
"26_2",
"25_2",
"24_2",
"23_2",
"22_1",
"0_21_2",
"0_20_2",
"0_19_1",
"0_18_1",
"0_17_2",
]
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0
- name: "Cache downloaded bitcoind"
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.cache/corepc/bitcoind
key: bitcoind-${{ runner.os }}-${{ runner.arch }}-${{ matrix.version }}
- name: "Run integration tests"
env:
BITCOIND_DOWNLOAD_DIR: ${{ github.workspace }}/.cache/corepc/bitcoind
run: cd integration_test && cargo test --features=${{ matrix.version }},download
# The jobs below copied from electrsd repo during import. Not too
# much further thought given to it.
test-electrs:
name: Test Electrs
runs-on: ubuntu-24.04
env:
CARGO_TERM_COLOR: always
RUST_LOG: debug
strategy:
matrix:
features:
- bitcoind_22_1,bitcoind_download,electrs_0_8_10
- bitcoind_22_1,bitcoind_download,electrs_0_9_1
- bitcoind_22_1,bitcoind_download,electrs_0_9_11
- bitcoind_22_1,bitcoind_download,electrs_0_10_6
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
- run: cd electrsd && cargo test --no-default-features --features ${{ matrix.features }}
test-electrs-esplora:
name: Test Electrs Esplora
runs-on: ubuntu-24.04
env:
CARGO_TERM_COLOR: always
RUST_LOG: debug
strategy:
matrix:
features: ["bitcoind_22_1,bitcoind_download,legacy,esplora_a33e97e1"]
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
- run: cd electrsd && cargo test --no-default-features --features ${{ matrix.features }}
test-electrs-no-download:
name: Test Electrs no auto-download features
runs-on: ubuntu-24.04
env:
CARGO_TERM_COLOR: always
RUST_LOG: debug
ELECTRSD_SKIP_DOWNLOAD: "1"
ELECTRS_EXEC: "/home/runner/.cargo-install/electrs/bin/electrs"
steps:
- uses: dtolnay/rust-toolchain@stable
- name: Install LLVM and Clang
run: |
sudo apt-get update -y
sudo apt-get install -y clang libclang-dev llvm-dev
llvm_config="$(command -v llvm-config || true)"
if [[ -z "$llvm_config" ]]; then
llvm_config="$(command -v llvm-config-18 || true)"
fi
if [[ -z "$llvm_config" ]]; then
echo "llvm-config not found after installing LLVM packages" >&2
exit 1
fi
echo "LLVM_CONFIG_PATH=$llvm_config" >> "$GITHUB_ENV"
echo "LIBCLANG_PATH=$($llvm_config --libdir)" >> "$GITHUB_ENV"
- name: Install electrs
# Automatically cache installed binaries to avoid compiling them each run
uses: baptiste0928/cargo-install@v2
with:
crate: electrs
version: 0.10.6
locked: true
- run: "echo $ELECTRS_EXEC"
- name: Checkout Crate
uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- run: cd electrsd && cargo test --no-default-features --features 'bitcoind_25_2,electrs_0_10_6,bitcoind_download'