Repository navigation
Merge pull request #1187 from tnull/2026-10-widen-rusqlite #4342
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 - Rust Tests | |
| on: [push, pull_request] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| rusqlite-compat: | |
| runs-on: self-hosted | |
| timeout-minutes: 30 | |
| strategy: | |
| matrix: | |
| # Keep these endpoints in sync with the supported range in Cargo.toml. | |
| rusqlite: ["0.31.0", "0.39.0"] | |
| env: | |
| CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: fallback | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install MSRV toolchain | |
| run: rustup toolchain install 1.85.0 --profile minimal | |
| - name: Test downstream rusqlite compatibility on MSRV | |
| run: | | |
| export CARGO_TARGET_DIR=$(mktemp -d /tmp/cargo-target-ldk-node-rusqlite-XXXXXX) | |
| trap 'rm -rf "$CARGO_TARGET_DIR"' EXIT | |
| cargo +1.85.0 add --manifest-path tests/rusqlite-compat/Cargo.toml rusqlite@=${{ matrix.rusqlite }} | |
| cargo +1.85.0 test --manifest-path tests/rusqlite-compat/Cargo.toml | |
| build: | |
| timeout-minutes: 120 | |
| strategy: | |
| matrix: | |
| platform: [ | |
| self-hosted, | |
| macos-latest, | |
| windows-latest, | |
| ] | |
| toolchain: [ | |
| stable, | |
| beta, | |
| 1.85.0, # Our MSRV | |
| ] | |
| include: | |
| - toolchain: stable | |
| check-fmt: true | |
| build-uniffi: true | |
| platform: self-hosted | |
| - toolchain: stable | |
| platform: macos-latest | |
| - toolchain: stable | |
| platform: windows-latest | |
| - toolchain: 1.85.0 | |
| msrv: true | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust ${{ matrix.toolchain }} toolchain | |
| run: | | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ matrix.toolchain }} | |
| - name: Check formatting on Rust ${{ matrix.toolchain }} | |
| if: matrix.check-fmt | |
| run: rustup component add rustfmt && cargo fmt --all -- --check | |
| - name: Pin packages to allow for MSRV | |
| if: matrix.msrv | |
| run: | | |
| cargo update -p idna_adapter --precise "1.2.0" --verbose # idna_adapter 1.2.1 uses ICU4X 2.2.0, requiring 1.86 and newer | |
| cargo update -p encoding_rs --precise "0.8.35" --verbose # encoding_rs 0.8.40 and newer require 1.88 and newer | |
| cargo update -p proptest --precise "1.11.0" --verbose # proptest 1.12.0 requires Rust 1.88 | |
| - name: Set RUSTFLAGS to deny warnings | |
| if: "matrix.toolchain == 'stable'" | |
| run: echo "RUSTFLAGS=-D warnings" >> "$GITHUB_ENV" | |
| - name: Enable caching for bitcoind | |
| id: cache-bitcoind | |
| uses: actions/cache@v4 | |
| with: | |
| path: bin/bitcoind-${{ runner.os }}-${{ runner.arch }} | |
| key: bitcoind-31.1-${{ 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-${{ runner.os }}-${{ runner.arch }} | |
| - name: Download bitcoind/electrs | |
| if: "matrix.platform != 'windows-latest' && (steps.cache-bitcoind.outputs.cache-hit != 'true' || steps.cache-electrs.outputs.cache-hit != 'true')" | |
| run: | | |
| source ./scripts/download_bitcoind_electrs.sh | |
| mkdir -p bin | |
| mv "$BITCOIND_EXE" bin/bitcoind-${{ runner.os }}-${{ runner.arch }} | |
| 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: Build on Rust ${{ matrix.toolchain }} | |
| run: cargo build --verbose --color always | |
| - name: Build with UniFFI support on Rust ${{ matrix.toolchain }} | |
| if: matrix.build-uniffi | |
| run: cargo build --no-default-features --features uniffi-default --verbose --color always | |
| - name: Check release build on Rust ${{ matrix.toolchain }} | |
| run: cargo check --release --verbose --color always | |
| - name: Check release build with UniFFI support on Rust ${{ matrix.toolchain }} | |
| if: matrix.build-uniffi | |
| run: cargo check --release --no-default-features --features uniffi-default --verbose --color always | |
| - name: Test on Rust ${{ matrix.toolchain }} | |
| if: "matrix.platform != 'windows-latest'" | |
| run: | | |
| RUSTFLAGS="--cfg cycle_tests --cfg tokio_unstable" cargo test | |
| - name: Test with UniFFI support on Rust ${{ matrix.toolchain }} | |
| if: "matrix.platform != 'windows-latest' && matrix.build-uniffi" | |
| run: | | |
| RUSTFLAGS="--cfg cycle_tests" cargo test --no-default-features --features uniffi-default | |
| linting: | |
| name: Linting | |
| timeout-minutes: 120 | |
| 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: Add clippy component | |
| run: rustup component add clippy | |
| - name: Ban `unwrap` in library code | |
| run: | | |
| cargo clippy --lib --verbose --color always -- -A warnings -D clippy::unwrap_used -A clippy::tabs_in_doc_comments | |
| cargo clippy --lib --no-default-features --features uniffi-default --verbose --color always -- -A warnings -D clippy::unwrap_used -A clippy::tabs_in_doc_comments | |
| doc: | |
| name: Documentation | |
| timeout-minutes: 120 | |
| runs-on: self-hosted | |
| env: | |
| RUSTDOCFLAGS: -Dwarnings | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| - uses: dtolnay/install@cargo-docs-rs | |
| - run: cargo docs-rs |