From 735c116e16314d63e6add6aec4a3925d87155195 Mon Sep 17 00:00:00 2001 From: valued mammal Date: Mon, 20 Jan 2025 11:37:40 -0500 Subject: [PATCH] ci: separate check and test jobs - build-test is changed to build-check - add jobs test-bdk and test-electrum - add ci/pin-msrv.sh, which pins the dependencies for 1.63.0 MSRV --- .github/workflows/cont_integration.yml | 99 +++++++++++++++++++------- ci/pin-msrv.sh | 24 +++++++ 2 files changed, 97 insertions(+), 26 deletions(-) create mode 100755 ci/pin-msrv.sh diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml index 6a57c9c5b..e6c5a2ae0 100644 --- a/.github/workflows/cont_integration.yml +++ b/.github/workflows/cont_integration.yml @@ -15,9 +15,9 @@ jobs: id: read_toolchain run: echo "rust_version=$(cat rust-version)" >> $GITHUB_OUTPUT - build-test: + build-check: needs: prepare - name: Build and test + name: Build & Check runs-on: ubuntu-latest strategy: matrix: @@ -40,38 +40,84 @@ jobs: profile: minimal - name: Rust Cache uses: Swatinem/rust-cache@v2.7.5 - - name: Pin dependencies for MSRV + - name: Pin dependencies for 1.75 + if: matrix.rust.version == '1.75.0' run: | - if [ "${{matrix.rust.version}}" = '1.63.0' ]; then - cargo update -p zstd-sys --precise "2.0.8+zstd.1.5.5" - cargo update -p time --precise "0.3.20" - cargo update -p home --precise "0.5.5" - cargo update -p proptest --precise "1.2.0" - cargo update -p url --precise "2.5.0" - cargo update -p cc --precise "1.0.105" - cargo update -p tokio --precise "1.38.1" - cargo update -p tokio-util --precise "0.7.11" - cargo update -p indexmap --precise "2.5.0" - cargo update -p security-framework-sys --precise "2.11.1" - cargo update -p csv --precise "1.3.0" - cargo update -p unicode-width --precise "0.1.13" - elif [ "${{matrix.rust.version}}" = '1.75.0' ]; then - cargo update -p home --precise "0.5.9" - fi - - name: Build + cargo update -p home --precise "0.5.9" + - name: Pin dependencies for MSRV + if: matrix.rust.version == '1.63.0' + run: ./ci/pin-msrv.sh + - name: Build + Check run: | if [ "${{matrix.rust.version}}" = '1.63.0' ]; then cargo build --workspace --exclude 'example_*' --exclude 'bdk_electrum' ${{ matrix.features }} + cargo check --workspace --exclude 'example_*' --exclude 'bdk_electrum' ${{ matrix.features }} else cargo build --workspace --exclude 'example_*' ${{ matrix.features }} + cargo check --workspace --exclude 'example_*' ${{ matrix.features }} fi - - name: Test + + test-bdk: + needs: prepare + name: Test BDK + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - version: ${{ needs.prepare.outputs.rust_version }} + - version: 1.63.0 # MSRV + features: + - --no-default-features --features miniscript/no-std + - --all-features + steps: + - name: checkout + uses: actions/checkout@v4 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@v1 + with: + toolchain: ${{ matrix.rust.version }} + - name: Rust Cache + uses: Swatinem/rust-cache@v2.7.5 + - name: Pin dependencies for MSRV + if: matrix.rust.version == '1.63.0' + run: ./ci/pin-msrv.sh + - name: Test library run: | - if [ "${{matrix.rust.version}}" = '1.63.0' ]; then - cargo test --workspace --exclude 'example_*' --exclude 'bdk_electrum' ${{ matrix.features }} - else - cargo test --workspace --exclude 'example_*' ${{ matrix.features }} - fi + cargo test -p bdk_core ${{ matrix.features }} + cargo test -p bdk_chain ${{ matrix.features }} + cargo test -p bdk_bitcoind_rpc ${{ matrix.features }} -- --test-threads=2 + cargo test -p bdk_esplora ${{ matrix.features }} -- --test-threads=2 + cargo test -p bdk_file_store ${{ matrix.features }} + cargo test -p bdk_testenv ${{ matrix.features }} -- --test-threads=2 + cargo test -p bdk_wallet ${{ matrix.features }} + + test-electrum: + needs: prepare + name: Test `bdk_electrum` + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - version: ${{ needs.prepare.outputs.rust_version }} + - version: 1.75.0 # MSRV + features: + - --no-default-features --features miniscript/no-std + - --all-features + steps: + - name: checkout + uses: actions/checkout@v4 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@v1 + with: + toolchain: ${{ matrix.rust.version }} + - name: Rust Cache + uses: Swatinem/rust-cache@v2.7.5 + - name: Pin dependencies for MSRV + if: matrix.rust.version == '1.75.0' + run: | + cargo update -p home --precise "0.5.9" + - name: Test electrum + run: cargo test -p bdk_electrum ${{ matrix.features }} -- --test-threads=2 check-no-std: needs: prepare @@ -151,6 +197,7 @@ jobs: clippy_check: needs: prepare + name: Rust clippy runs-on: ubuntu-latest permissions: checks: write diff --git a/ci/pin-msrv.sh b/ci/pin-msrv.sh new file mode 100755 index 000000000..07454d589 --- /dev/null +++ b/ci/pin-msrv.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -x +set -euo pipefail + +# Pin dependencies for MSRV + +# To pin deps, switch toolchain to MSRV and execute the below updates + +# cargo clean +# rustup default 1.63.0 + +cargo update -p zstd-sys --precise "2.0.8+zstd.1.5.5" +cargo update -p time --precise "0.3.20" +cargo update -p home --precise "0.5.5" +cargo update -p proptest --precise "1.2.0" +cargo update -p url --precise "2.5.0" +cargo update -p cc --precise "1.0.105" +cargo update -p tokio --precise "1.38.1" +cargo update -p tokio-util --precise "0.7.11" +cargo update -p indexmap --precise "2.5.0" +cargo update -p security-framework-sys --precise "2.11.1" +cargo update -p csv --precise "1.3.0" +cargo update -p unicode-width --precise "0.1.13"