From: Steve Myers Date: Mon, 21 Oct 2024 14:24:36 +0000 (-0500) Subject: ci: fix actions versions and pinned deps for MSRV X-Git-Tag: v0.30.0~6 X-Git-Url: http://internal-gitweb-vhost/?a=commitdiff_plain;h=64d2b7c2cb6c5b0814d1953d28f9d35388afaaa1;p=bdk ci: fix actions versions and pinned deps for MSRV --- diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 3c61162d..8a41b884 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -16,7 +16,7 @@ jobs: security_audit: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions-rs/audit-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml index 9ec5965c..bf47a7e2 100644 --- a/.github/workflows/code_coverage.yml +++ b/.github/workflows/code_coverage.yml @@ -21,19 +21,16 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install lcov tools run: sudo apt-get install lcov -y - - name: Install rustup - run: curl https://sh.rustup.rs -sSf | sh -s -- -y - - name: Set default toolchain - run: rustup default nightly - - name: Set profile - run: rustup set profile minimal - - name: Add llvm tools - run: rustup component add llvm-tools-preview - - name: Update toolchain - run: rustup update + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + components: llvm-tools-preview + profile: minimal - name: Cache cargo uses: actions/cache@v3 with: @@ -52,7 +49,7 @@ jobs: # For more info, see: # - https://github.com/bitcoindevkit/bdk/issues/696 # - https://github.com/bitcoindevkit/bdk/pull/748#issuecomment-1242721040 - run: cargo test --features all-keys,compact_filters,compiler,key-value-db,sqlite,sqlite-bundled,test-electrum,test-rpc,verify + run: cargo test --features all-keys,compact_filters,compiler,key-value-db,sqlite,sqlite-bundled,test-electrum,test-rpc,verify -- --test-threads=1 - name: Run grcov run: mkdir coverage; grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '/*' -o ./coverage/lcov.info - name: Generate HTML coverage report @@ -63,7 +60,7 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Upload artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: coverage-report path: coverage-report.html diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml index a3ae6f16..44dd5fd1 100644 --- a/.github/workflows/cont_integration.yml +++ b/.github/workflows/cont_integration.yml @@ -39,31 +39,32 @@ jobs: - sqlite-bundled steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Generate cache key run: echo "${{ matrix.rust.version }} ${{ matrix.features }}" | tee .cache_key - name: cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | ~/.cargo/registry ~/.cargo/git target key: ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} - - name: Set default toolchain - run: rustup default ${{ matrix.rust.version }} - - name: Set profile - run: rustup set profile minimal - - name: Add clippy - if: ${{ matrix.rust.clippy }} - run: rustup component add clippy - - name: Update toolchain - run: rustup update + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust.version }} + override: true + components: clippy + profile: minimal - name: Pin dependencies for MSRV if: matrix.rust.version == '1.63.0' run: | - cargo update -p regex --precise "1.7.3" + cargo update -p tokio --precise "1.38.1" + cargo update -p tokio-util --precise "0.7.11" cargo update -p home --precise "0.5.5" + cargo update -p regex --precise "1.7.3" + cargo update -p security-framework-sys --precise "2.11.1" - name: Build run: cargo build --features bitcoin/std,miniscript/std,${{ matrix.features }} --no-default-features - name: Clippy @@ -77,21 +78,22 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | ~/.cargo/registry ~/.cargo/git target key: ${{ runner.os }}-cargo-test-md-docs-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} - - name: Set default toolchain - run: rustup default nightly - - name: Set profile - run: rustup set profile minimal - - name: Update toolchain - run: rustup update + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + components: clippy + profile: minimal - name: Test run: cargo test --features bitcoin/std,miniscript/std,test-md-docs --no-default-features -- doctest::ReadmeDoctests @@ -100,6 +102,7 @@ jobs: runs-on: ubuntu-20.04 strategy: fail-fast: false + max-parallel: 1 matrix: blockchain: - name: electrum @@ -119,22 +122,23 @@ jobs: features: test-esplora,use-esplora-blocking,verify,bitcoin/std,miniscript/std steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | ~/.cargo/registry ~/.cargo/git target key: ${{ runner.os }}-cargo-${{ github.job }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} - - name: Setup rust toolchain + - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: toolchain: stable override: true + profile: minimal - name: Test - run: cargo test --no-default-features --features bitcoin/std,miniscript/std,${{ matrix.blockchain.features }} ${{ matrix.blockchain.testprefix }}::bdk_blockchain_tests + run: cargo test --no-default-features --features bitcoin/std,miniscript/std,${{ matrix.blockchain.features }} ${{ matrix.blockchain.testprefix }}::bdk_blockchain_tests -- --test-threads=1 check-wasm: name: Check WASM @@ -144,9 +148,9 @@ jobs: CFLAGS: -I/usr/include steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | ~/.cargo/registry @@ -158,14 +162,14 @@ jobs: - run: sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main" || exit 1 - run: sudo apt-get update || exit 1 - run: sudo apt-get install -y libclang-common-10-dev clang-10 libc6-dev-i386 || exit 1 - - name: Set default toolchain - run: rustup default stable - - name: Set profile - run: rustup set profile minimal + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + profile: minimal - name: Add target wasm32 run: rustup target add wasm32-unknown-unknown - - name: Update toolchain - run: rustup update - name: Check run: cargo check --target wasm32-unknown-unknown --features bitcoin/no-std,miniscript/no-std,async-interface,use-esplora-async,dev-getrandom-wasm --no-default-features @@ -174,15 +178,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 - - name: Set default toolchain - run: rustup default nightly - - name: Set profile - run: rustup set profile minimal - - name: Add rustfmt - run: rustup component add rustfmt - - name: Update toolchain - run: rustup update + uses: actions/checkout@v4 + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + components: rustfmt + profile: minimal - name: Check fmt run: cargo fmt --all -- --config format_code_in_doc_comments=true --check @@ -206,16 +209,19 @@ jobs: python-version: '3.9' - name: Install python dependencies run: pip install hwi==2.1.1 protobuf==3.20.1 - - name: Set default toolchain - run: rustup default ${{ matrix.rust.version }} - - name: Set profile - run: rustup set profile minimal - - name: Update toolchain - run: rustup update + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust.version }} + override: true + profile: minimal - name: Pin dependencies for MSRV if: matrix.rust.version == '1.63.0' run: | - cargo update -p regex --precise "1.7.3" + cargo update -p tokio --precise "1.38.1" + cargo update -p tokio-util --precise "0.7.11" cargo update -p home --precise "0.5.5" + cargo update -p regex --precise "1.7.3" + cargo update -p security-framework-sys --precise "2.11.1" - name: Test run: cargo test --features test-hardware-signer diff --git a/.github/workflows/nightly_docs.yml b/.github/workflows/nightly_docs.yml index f122d068..ff52ed41 100644 --- a/.github/workflows/nightly_docs.yml +++ b/.github/workflows/nightly_docs.yml @@ -16,25 +16,26 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | ~/.cargo/registry ~/.cargo/git target key: nightly-docs-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} - - name: Set default toolchain - run: rustup default nightly-2022-12-14 - - name: Set profile - run: rustup set profile minimal - - name: Update toolchain - run: rustup update + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + components: clippy + profile: minimal - name: Build docs run: cargo rustdoc --verbose --features=compiler,electrum,esplora,use-esplora-blocking,compact_filters,rpc,key-value-db,sqlite,all-keys,verify,hardware-signer -- --cfg docsrs -Dwarnings - name: Upload artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: built-docs path: ./target/doc/* @@ -46,7 +47,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout `bitcoindevkit.org` - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ssh-key: ${{ secrets.DOCS_PUSH_SSH_KEY }} repository: bitcoindevkit/bitcoindevkit.org diff --git a/Cargo.toml b/Cargo.toml index a2deaaba..50f3fd22 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -111,7 +111,7 @@ miniscript = { version = "10.0", features = ["std"] } bitcoin = { version = "0.30", features = ["std"] } lazy_static = "1.4" env_logger = { version = "0.7", default-features = false } -electrsd = "0.24" +electrsd = "0.24.0" assert_matches = "1.5.0" [[example]] @@ -130,7 +130,7 @@ path = "examples/policy.rs" [[example]] name = "rpcwallet" path = "examples/rpcwallet.rs" -required-features = ["keys-bip39", "key-value-db", "rpc", "electrsd/bitcoind_22_0"] +required-features = ["keys-bip39", "key-value-db", "rpc", "electrsd/bitcoind_23_0"] [[example]] name = "psbt_signer" diff --git a/README.md b/README.md index 39a1b8ea..68202814 100644 --- a/README.md +++ b/README.md @@ -209,6 +209,9 @@ This library should compile with any combination of features with Rust 1.63.0. To build with the MSRV you will need to pin dependencies as follows: ```shell -cargo update -p regex --precise "1.7.3" +cargo update -p tokio --precise "1.38.1" +cargo update -p tokio-util --precise "0.7.11" cargo update -p home --precise "0.5.5" +cargo update -p regex --precise "1.7.3" +cargo update -p security-framework-sys --precise "2.11.1" ``` diff --git a/examples/electrum_backend.rs b/examples/electrum_backend.rs index af81eb18..8aa084c7 100644 --- a/examples/electrum_backend.rs +++ b/examples/electrum_backend.rs @@ -83,5 +83,5 @@ fn run(network: &Network, electrum_url: &str, xpriv: &str) { .map_err(bdk::Error::Generic) .unwrap(); - println!("------\nWallet Backup: {}", export.to_string()); + println!("------\nWallet Backup: {}", export); } diff --git a/src/database/mod.rs b/src/database/mod.rs index ab5075d1..27d6e4db 100644 --- a/src/database/mod.rs +++ b/src/database/mod.rs @@ -114,7 +114,7 @@ pub trait BatchOperations { pub trait Database: BatchOperations { /// Read and checks the descriptor checksum for a given keychain. /// - /// Should return [`Error::ChecksumMismatch`](crate::error::Error::ChecksumMismatch) if the + /// Should return [`Error::ChecksumMismatch`] if the /// checksum doesn't match. If there's no checksum in the database, simply store it for the /// next time. fn check_descriptor_checksum>( diff --git a/src/keys/mod.rs b/src/keys/mod.rs index ee81e8e8..140f7dfd 100644 --- a/src/keys/mod.rs +++ b/src/keys/mod.rs @@ -410,7 +410,7 @@ impl From for ExtendedKey { /// } /// ``` /// -/// Types that don't internally encode the [`Network`](bitcoin::Network) in which they are valid need some extra +/// Types that don't internally encode the [`Network`] in which they are valid need some extra /// steps to override the set of valid networks, otherwise only the network specified in the /// [`ExtendedPrivKey`] or [`ExtendedPubKey`] will be considered valid. /// diff --git a/src/wallet/tx_builder.rs b/src/wallet/tx_builder.rs index 99057874..16488ac2 100644 --- a/src/wallet/tx_builder.rs +++ b/src/wallet/tx_builder.rs @@ -504,7 +504,7 @@ impl<'a, D: BatchDatabase, Cs: CoinSelectionAlgorithm, Ctx: TxBuilderContext> /// Choose the coin selection algorithm /// - /// Overrides the [`DefaultCoinSelectionAlgorithm`](super::coin_selection::DefaultCoinSelectionAlgorithm). + /// Overrides the [`DefaultCoinSelectionAlgorithm`]. /// /// Note that this function consumes the builder and returns it so it is usually best to put this as the first call on the builder. pub fn coin_selection>(