Skip to content

Commit 735c116

Browse files
ValuedMammaloleonardolima
authored andcommitted
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
1 parent ee71bd3 commit 735c116

File tree

2 files changed

+97
-26
lines changed

2 files changed

+97
-26
lines changed

.github/workflows/cont_integration.yml

Lines changed: 73 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
id: read_toolchain
1616
run: echo "rust_version=$(cat rust-version)" >> $GITHUB_OUTPUT
1717

18-
build-test:
18+
build-check:
1919
needs: prepare
20-
name: Build and test
20+
name: Build & Check
2121
runs-on: ubuntu-latest
2222
strategy:
2323
matrix:
@@ -40,38 +40,84 @@ jobs:
4040
profile: minimal
4141
- name: Rust Cache
4242
uses: Swatinem/[email protected]
43-
- name: Pin dependencies for MSRV
43+
- name: Pin dependencies for 1.75
44+
if: matrix.rust.version == '1.75.0'
4445
run: |
45-
if [ "${{matrix.rust.version}}" = '1.63.0' ]; then
46-
cargo update -p zstd-sys --precise "2.0.8+zstd.1.5.5"
47-
cargo update -p time --precise "0.3.20"
48-
cargo update -p home --precise "0.5.5"
49-
cargo update -p proptest --precise "1.2.0"
50-
cargo update -p url --precise "2.5.0"
51-
cargo update -p cc --precise "1.0.105"
52-
cargo update -p tokio --precise "1.38.1"
53-
cargo update -p tokio-util --precise "0.7.11"
54-
cargo update -p indexmap --precise "2.5.0"
55-
cargo update -p security-framework-sys --precise "2.11.1"
56-
cargo update -p csv --precise "1.3.0"
57-
cargo update -p unicode-width --precise "0.1.13"
58-
elif [ "${{matrix.rust.version}}" = '1.75.0' ]; then
59-
cargo update -p home --precise "0.5.9"
60-
fi
61-
- name: Build
46+
cargo update -p home --precise "0.5.9"
47+
- name: Pin dependencies for MSRV
48+
if: matrix.rust.version == '1.63.0'
49+
run: ./ci/pin-msrv.sh
50+
- name: Build + Check
6251
run: |
6352
if [ "${{matrix.rust.version}}" = '1.63.0' ]; then
6453
cargo build --workspace --exclude 'example_*' --exclude 'bdk_electrum' ${{ matrix.features }}
54+
cargo check --workspace --exclude 'example_*' --exclude 'bdk_electrum' ${{ matrix.features }}
6555
else
6656
cargo build --workspace --exclude 'example_*' ${{ matrix.features }}
57+
cargo check --workspace --exclude 'example_*' ${{ matrix.features }}
6758
fi
68-
- name: Test
59+
60+
test-bdk:
61+
needs: prepare
62+
name: Test BDK
63+
runs-on: ubuntu-latest
64+
strategy:
65+
matrix:
66+
rust:
67+
- version: ${{ needs.prepare.outputs.rust_version }}
68+
- version: 1.63.0 # MSRV
69+
features:
70+
- --no-default-features --features miniscript/no-std
71+
- --all-features
72+
steps:
73+
- name: checkout
74+
uses: actions/checkout@v4
75+
- name: Install Rust toolchain
76+
uses: dtolnay/rust-toolchain@v1
77+
with:
78+
toolchain: ${{ matrix.rust.version }}
79+
- name: Rust Cache
80+
uses: Swatinem/[email protected]
81+
- name: Pin dependencies for MSRV
82+
if: matrix.rust.version == '1.63.0'
83+
run: ./ci/pin-msrv.sh
84+
- name: Test library
6985
run: |
70-
if [ "${{matrix.rust.version}}" = '1.63.0' ]; then
71-
cargo test --workspace --exclude 'example_*' --exclude 'bdk_electrum' ${{ matrix.features }}
72-
else
73-
cargo test --workspace --exclude 'example_*' ${{ matrix.features }}
74-
fi
86+
cargo test -p bdk_core ${{ matrix.features }}
87+
cargo test -p bdk_chain ${{ matrix.features }}
88+
cargo test -p bdk_bitcoind_rpc ${{ matrix.features }} -- --test-threads=2
89+
cargo test -p bdk_esplora ${{ matrix.features }} -- --test-threads=2
90+
cargo test -p bdk_file_store ${{ matrix.features }}
91+
cargo test -p bdk_testenv ${{ matrix.features }} -- --test-threads=2
92+
cargo test -p bdk_wallet ${{ matrix.features }}
93+
94+
test-electrum:
95+
needs: prepare
96+
name: Test `bdk_electrum`
97+
runs-on: ubuntu-latest
98+
strategy:
99+
matrix:
100+
rust:
101+
- version: ${{ needs.prepare.outputs.rust_version }}
102+
- version: 1.75.0 # MSRV
103+
features:
104+
- --no-default-features --features miniscript/no-std
105+
- --all-features
106+
steps:
107+
- name: checkout
108+
uses: actions/checkout@v4
109+
- name: Install Rust toolchain
110+
uses: dtolnay/rust-toolchain@v1
111+
with:
112+
toolchain: ${{ matrix.rust.version }}
113+
- name: Rust Cache
114+
uses: Swatinem/[email protected]
115+
- name: Pin dependencies for MSRV
116+
if: matrix.rust.version == '1.75.0'
117+
run: |
118+
cargo update -p home --precise "0.5.9"
119+
- name: Test electrum
120+
run: cargo test -p bdk_electrum ${{ matrix.features }} -- --test-threads=2
75121

76122
check-no-std:
77123
needs: prepare
@@ -151,6 +197,7 @@ jobs:
151197

152198
clippy_check:
153199
needs: prepare
200+
name: Rust clippy
154201
runs-on: ubuntu-latest
155202
permissions:
156203
checks: write

ci/pin-msrv.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
set -x
4+
set -euo pipefail
5+
6+
# Pin dependencies for MSRV
7+
8+
# To pin deps, switch toolchain to MSRV and execute the below updates
9+
10+
# cargo clean
11+
# rustup default 1.63.0
12+
13+
cargo update -p zstd-sys --precise "2.0.8+zstd.1.5.5"
14+
cargo update -p time --precise "0.3.20"
15+
cargo update -p home --precise "0.5.5"
16+
cargo update -p proptest --precise "1.2.0"
17+
cargo update -p url --precise "2.5.0"
18+
cargo update -p cc --precise "1.0.105"
19+
cargo update -p tokio --precise "1.38.1"
20+
cargo update -p tokio-util --precise "0.7.11"
21+
cargo update -p indexmap --precise "2.5.0"
22+
cargo update -p security-framework-sys --precise "2.11.1"
23+
cargo update -p csv --precise "1.3.0"
24+
cargo update -p unicode-width --precise "0.1.13"

0 commit comments

Comments
 (0)