Skip to content

Commit afb2d78

Browse files
committed
build: add minimal dependency versions test
Add a check that the dependency contraints of the crate are till valid, specifically, the minimum versions. This ensrues we do not start to depend on new features of a dependency by accident without updating the manifest. This new test revealed that we need tokio to be at least version 1.19 since we are using the "is_finished" function. The "-f" option was added to the delete lockfile recipe so that no errors are thrown if the file does not exist.
1 parent f21e475 commit afb2d78

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,12 @@ jobs:
6868
- uses: extractions/setup-just@v3
6969
- uses: actions-rust-lang/setup-rust-toolchain@v1
7070
- run: just test integration
71+
min-versions:
72+
runs-on: ubuntu-latest
73+
steps:
74+
- uses: actions/checkout@v4
75+
- uses: extractions/setup-just@v3
76+
- uses: actions-rust-lang/setup-rust-toolchain@v1
77+
with:
78+
toolchain: nightly
79+
- run: just test min-versions

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ bitcoin = { version = "0.32.5", default-features = false, features = [
1818
bip324 = { version = "0.7.0", default-features = false, features = [
1919
"tokio",
2020
] }
21-
tokio = { version = "1", default-features = false, features = [
21+
tokio = { version = "1.19", default-features = false, features = [
2222
"rt-multi-thread",
2323
"sync",
2424
"time",
@@ -43,7 +43,7 @@ hex = { version = "0.4.0" }
4343
tracing = "0.1"
4444
tracing-subscriber = "0.3"
4545
tempfile = "3"
46-
tokio = { version = "1.37", default-features = false, features = [
46+
tokio = { version = "1.19", default-features = false, features = [
4747
"full",
4848
] }
4949

justfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ check:
1111
cargo clippy --all-targets -- -D warnings
1212
cargo check --all-features
1313

14-
# Run a test suite: unit, integration, features, msrv, or sync.
14+
# Run a test suite: unit, integration, features, msrv, min-versions, or sync.
1515
test suite="unit":
1616
just _test-{{suite}}
1717

@@ -36,6 +36,11 @@ _test-features:
3636
cargo test --lib --no-default-features
3737
cargo test --lib --no-default-features --features rusqlite,filter-control
3838

39+
# Test that minimum versions of dependency contraints are still valid.
40+
_test-min-versions:
41+
just _delete-lockfile
42+
cargo +nightly check --all-features -Z direct-minimal-versions
43+
3944
# Check code with MSRV compiler.
4045
_test-msrv:
4146
# Handles creating sandboxed environments to ensure no newer binaries sneak in.
@@ -54,7 +59,7 @@ _delete-data:
5459
rm -rf light_client_data
5560

5661
_delete-lockfile:
57-
rm Cargo.lock
62+
rm -f Cargo.lock
5863

5964
_delete-branches:
6065
git branch --merged | grep -v \* | xargs git branch -d

0 commit comments

Comments
 (0)