diff --git a/.github/workflows/.#rust.yml b/.github/workflows/.#rust.yml new file mode 120000 index 0000000..5792e15 --- /dev/null +++ b/.github/workflows/.#rust.yml @@ -0,0 +1 @@ +tobin@pantera.283300:1761534469 \ No newline at end of file diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index fa46ed8..1216974 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -50,7 +50,7 @@ jobs: DO_NO_STD: true run: ./contrib/test.sh - MSRV: + MSRV-1-41: name: Test - 1.41.1 toolchain runs-on: ubuntu-latest strategy: @@ -66,6 +66,54 @@ jobs: DO_FEATURE_MATRIX: true run: ./contrib/test.sh + MSRV-1-48: + name: Test - 1.48.0 toolchain + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - name: Checkout Crate + uses: actions/checkout@v3 + - name: Checkout Toolchain + uses: dtolnay/rust-toolchain@1.48.0 + - name: Running test script + env: + DO_NO_STD: true + DO_FEATURE_MATRIX: true + run: ./contrib/test.sh + + MSRV-1-51: + name: Test - 1.51.0 toolchain + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - name: Checkout Crate + uses: actions/checkout@v3 + - name: Checkout Toolchain + uses: dtolnay/rust-toolchain@1.51.0 + - name: Running test script + env: + DO_NO_STD: true + DO_FEATURE_MATRIX: true + run: ./contrib/test.sh + + MSRV-1-56: + name: Test - 1.56.0 toolchain + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - name: Checkout Crate + uses: actions/checkout@v3 + - name: Checkout Toolchain + uses: dtolnay/rust-toolchain@1.56.0 + - name: Running test script + env: + DO_NO_STD: true + DO_FEATURE_MATRIX: true + run: ./contrib/test.sh + Arch32bit: name: Test 32-bit version runs-on: ubuntu-latest diff --git a/Cargo.toml b/Cargo.toml index 2dabf65..9885079 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,13 +49,13 @@ serde = { version = "1.0", default-features = false, features = [ "alloc" ], opt zeroize = { version = "1.5", features = ["zeroize_derive"], optional = true } # Unexported dependnecies -bitcoin_hashes = { version = ">=0.12, <=0.13", default-features = false } +bitcoin_hashes = { version = ">=0.12,<0.15", default-features = false } unicode-normalization = { version = "0.1.22", default-features = false, optional = true } [dev-dependencies] # Enabling the "rand" feature by default to run the benches bip39 = { path = ".", features = ["rand"] } -bitcoin_hashes = ">=0.12,<0.14" # enable default features for test +bitcoin_hashes = ">=0.12,<0.15" # enable default features for test [package.metadata.docs.rs] diff --git a/README.md b/README.md index b689e88..15780f0 100644 --- a/README.md +++ b/README.md @@ -33,11 +33,12 @@ This crate supports Rust v1.41.1 and up and works with `no_std`. The `bitcoin_hashes` range dependency effects the MSRV as follows -- `bitcoin_hashes v0.12`: MSRV v1.41.1 -- `bitcoin_hashes v0.13`: MSRV v1.48.0 +- `bitcoin_hashes v0.12`: MSRV `v1.41.1` +- `bitcoin_hashes v0.13`: MSRV `v1.48.0` +- `bitcoin_hashes v0.14`: MSRV `v1.56.1` When using older version of Rust, you might have to pin the versions of several crates, for an up-to-date list refer to [`contrib/test.sh`](contrib/test.sh): - + ```bash cargo update --package "bitcoin_hashes" --precise "0.12.0" cargo update --package "rand" --precise "0.6.0" @@ -46,4 +47,4 @@ cargo update --package "tinyvec" --precise "1.6.0" cargo update --package "unicode-normalization" --precise "0.1.22" ``` -If you enable the `zeroize` feature the MSRV becomes 1.51. +If you enable the `zeroize` feature the MSRV becomes `v1.51.0`. diff --git a/contrib/test.sh b/contrib/test.sh index 85ddac4..0ea920b 100755 --- a/contrib/test.sh +++ b/contrib/test.sh @@ -3,16 +3,20 @@ set -ex FEATURES="serde rand all-languages chinese-simplified chinese-traditional czech french italian japanese korean portuguese spanish" +RUSTC_MINOR_VERSION=$(rustc --version | awk '{ split($2,a,"."); print a[2] }') cargo --version rustc --version -# Pin dependencies as required if we are using MSRV toolchain. -if cargo --version | grep "1\.41"; then +# Check the minimal lock file for all MSRV toolchains we test. +if [ "$RUSTC_MINOR_VERSION" -eq 56 ]; then cp Cargo-minimal.lock Cargo.lock cargo check --locked rm Cargo.lock +fi +# The crate's lowest MSRV (not lifted by `bitcoin_hashes` dep or `zeroize` feature). +if [ "$RUSTC_MINOR_VERSION" -eq 41 ]; then cargo update --package "bitcoin_hashes" --precise "0.12.0" cargo update --package "rand" --precise "0.6.0" cargo update --package "libc" --precise "0.2.151" @@ -20,6 +24,10 @@ if cargo --version | grep "1\.41"; then cargo update --package "unicode-normalization" --precise "0.1.22" fi +# `bitcoin_hashes` version raises the crate MSRV, we test with these toolchains explicitly in CI. +[ "$RUSTC_MINOR_VERSION" -eq 48 ] && cargo update --package "bitcoin_hashes" --precise "0.13.0" +[ "$RUSTC_MINOR_VERSION" -eq 56 ] && cargo update --package "bitcoin_hashes" --precise "0.14.0" + echo "********* Testing std *************" # Test without any features other than std first cargo test --verbose --no-default-features --features="std" @@ -34,7 +42,7 @@ do cargo build --verbose --features="$feature" --no-default-features done -if cargo --version | grep -v "1\.41"; then +if [ "$RUSTC_MINOR_VERSION" -ge 51 ]; then cargo build --verbose --features="zeroize" --no-default-features fi