Skip to content

Commit b3f9c4d

Browse files
committed
CI: Test MSRV
There are multiple MSRVs in this crate because of the `bitcoin_hashes` dependency and also the `zeroize` feature. Add MSRV test jobs for the three MSRVs effected by `bitcoin_hashes` and also one for the `zeroize` feature.
1 parent e30b544 commit b3f9c4d

File tree

3 files changed

+72
-6
lines changed

3 files changed

+72
-6
lines changed

.github/workflows/rust.yml

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
DO_NO_STD: true
5151
run: ./contrib/test.sh
5252

53-
MSRV:
53+
MSRV-1.41:
5454
name: Test - 1.41.1 toolchain
5555
runs-on: ubuntu-latest
5656
strategy:
@@ -66,6 +66,54 @@ jobs:
6666
DO_FEATURE_MATRIX: true
6767
run: ./contrib/test.sh
6868

69+
MSRV-1.48:
70+
name: Test - 1.48.1 toolchain
71+
runs-on: ubuntu-latest
72+
strategy:
73+
fail-fast: false
74+
steps:
75+
- name: Checkout Crate
76+
uses: actions/checkout@v3
77+
- name: Checkout Toolchain
78+
uses: dtolnay/[email protected]
79+
- name: Running test script
80+
env:
81+
DO_NO_STD: true
82+
DO_FEATURE_MATRIX: true
83+
run: ./contrib/test.sh
84+
85+
MSRV-1.51:
86+
name: Test - 1.51.1 toolchain
87+
runs-on: ubuntu-latest
88+
strategy:
89+
fail-fast: false
90+
steps:
91+
- name: Checkout Crate
92+
uses: actions/checkout@v3
93+
- name: Checkout Toolchain
94+
uses: dtolnay/[email protected]
95+
- name: Running test script
96+
env:
97+
DO_NO_STD: true
98+
DO_FEATURE_MATRIX: true
99+
run: ./contrib/test.sh
100+
101+
MSRV-1.56:
102+
name: Test - 1.56.0 toolchain
103+
runs-on: ubuntu-latest
104+
strategy:
105+
fail-fast: false
106+
steps:
107+
- name: Checkout Crate
108+
uses: actions/checkout@v3
109+
- name: Checkout Toolchain
110+
uses: dtolnay/[email protected]
111+
- name: Running test script
112+
env:
113+
DO_NO_STD: true
114+
DO_FEATURE_MATRIX: true
115+
run: ./contrib/test.sh
116+
69117
Arch32bit:
70118
name: Test 32-bit version
71119
runs-on: ubuntu-latest

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ This crate supports Rust v1.41.1 and up and works with `no_std`.
3333

3434
The `bitcoin_hashes` range dependency effects the MSRV as follows
3535

36-
- `bitcoin_hashes v0.12`: MSRV v1.41.1
37-
- `bitcoin_hashes v0.13`: MSRV v1.48.0
38-
- `bitcoin_hashes v0.14`: MSRV v1.56.1
36+
- `bitcoin_hashes v0.12`: MSRV `v1.41.1`
37+
- `bitcoin_hashes v0.13`: MSRV `v1.48.0`
38+
- `bitcoin_hashes v0.14`: MSRV `v1.56.1`
3939

4040
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):
4141

@@ -47,4 +47,4 @@ cargo update --package "tinyvec" --precise "1.6.0"
4747
cargo update --package "unicode-normalization" --precise "0.1.22"
4848
```
4949

50-
If you enable the `zeroize` feature the MSRV becomes 1.51.
50+
If you enable the `zeroize` feature the MSRV becomes `v1.51.0`.

contrib/test.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,24 @@ if cargo --version | grep "1\.41"; then
2020
cargo update --package "unicode-normalization" --precise "0.1.22"
2121
fi
2222

23+
# Pin dependencies as required if we are using MSRV toolchain.
24+
if cargo --version | grep "1\.48"; then
25+
cp Cargo-minimal.lock Cargo.lock
26+
cargo check --locked
27+
rm Cargo.lock
28+
29+
cargo update --package "bitcoin_hashes" --precise "0.13.0"
30+
fi
31+
32+
# Pin dependencies as required if we are using MSRV toolchain.
33+
if cargo --version | grep "1\.56"; then
34+
cp Cargo-minimal.lock Cargo.lock
35+
cargo check --locked
36+
rm Cargo.lock
37+
38+
cargo update --package "bitcoin_hashes" --precise "0.14.0"
39+
fi
40+
2341
echo "********* Testing std *************"
2442
# Test without any features other than std first
2543
cargo test --verbose --no-default-features --features="std"
@@ -34,7 +52,7 @@ do
3452
cargo build --verbose --features="$feature" --no-default-features
3553
done
3654

37-
if cargo --version | grep -v "1\.41"; then
55+
if cargo --version | grep "1\.51"; then
3856
cargo build --verbose --features="zeroize" --no-default-features
3957
fi
4058

0 commit comments

Comments
 (0)