|
3 | 3 | set -ex |
4 | 4 |
|
5 | 5 | FEATURES="serde rand all-languages chinese-simplified chinese-traditional czech french italian japanese korean portuguese spanish" |
| 6 | +RUSTC_MINOR_VERSION=$(rustc --version | awk '{ split($2,a,"."); print a[2] }') |
6 | 7 |
|
7 | 8 | cargo --version |
8 | 9 | rustc --version |
9 | 10 |
|
10 | | -# Pin dependencies as required if we are using MSRV toolchain. |
11 | | -if cargo --version | grep "1\.41"; then |
12 | | - cp Cargo-minimal.lock Cargo.lock |
13 | | - cargo check --locked |
14 | | - rm Cargo.lock |
| 11 | +[ "$RUSTC_MINOR_VERSION" -lt 82 ] && cargo update -p backtrace --precise "0.3.74" --verbose |
15 | 12 |
|
| 13 | +# Check the minimal lock file for all toolchains we test. |
| 14 | +cp Cargo-minimal.lock Cargo.lock |
| 15 | +cargo check --locked |
| 16 | +rm Cargo.lock |
| 17 | + |
| 18 | +# The crate's lowest MSRV (not lifted by `bitcoin_hashes` dep or `zeroize` feature). |
| 19 | +if [ "$RUSTC_MINOR_VERSION" -eq 41 ]; then |
16 | 20 | cargo update --package "bitcoin_hashes" --precise "0.12.0" |
17 | 21 | cargo update --package "rand" --precise "0.6.0" |
18 | 22 | cargo update --package "libc" --precise "0.2.151" |
19 | 23 | cargo update --package "tinyvec" --precise "1.6.0" |
20 | 24 | cargo update --package "unicode-normalization" --precise "0.1.22" |
21 | 25 | fi |
22 | 26 |
|
| 27 | +# `bitcoin_hashes` version raises the crate MSRV, we test with these toolchains explicitly in CI. |
| 28 | +[ "$RUSTC_MINOR_VERSION" -eq 48 ] && cargo update --package "bitcoin_hashes" --precise "0.13.0" |
| 29 | +[ "$RUSTC_MINOR_VERSION" -eq 56 ] && cargo update --package "bitcoin_hashes" --precise "0.14.0" |
| 30 | + |
23 | 31 | echo "********* Testing std *************" |
24 | 32 | # Test without any features other than std first |
25 | 33 | cargo test --verbose --no-default-features --features="std" |
|
34 | 42 | cargo build --verbose --features="$feature" --no-default-features |
35 | 43 | done |
36 | 44 |
|
37 | | -if cargo --version | grep -v "1\.41"; then |
| 45 | +if [ "$RUSTC_MINOR_VERSION" -ge 51 ]; then |
38 | 46 | cargo build --verbose --features="zeroize" --no-default-features |
39 | 47 | fi |
40 | 48 |
|
|
0 commit comments