Skip to content

Commit a493e00

Browse files
committed
Run test with recent/minimal lock files
Update the CI scripts to use the minimal/recent lockfiles, requires using `--locked` for various `cargo` incantations.
1 parent 5a2cab2 commit a493e00

File tree

2 files changed

+42
-23
lines changed

2 files changed

+42
-23
lines changed

contrib/_test.sh

+22-22
Original file line numberDiff line numberDiff line change
@@ -29,50 +29,50 @@ cargo test -- --ignored --exact 'tests::test_panic_raw_ctx_should_terminate_abno
2929
export CARGO_TERM_VERBOSE=true
3030

3131
# Defaults / sanity checks
32-
cargo build --all
33-
cargo test --all
32+
cargo build --locked --all
33+
cargo test --locked --all
3434

3535
if [ "$DO_FEATURE_MATRIX" = true ]; then
36-
cargo build --all --no-default-features
37-
cargo test --all --no-default-features
36+
cargo build --locked --all --no-default-features
37+
cargo test --locked --all --no-default-features
3838

3939
# All features
40-
cargo build --all --no-default-features --features="$FEATURES"
41-
cargo test --all --no-default-features --features="$FEATURES"
40+
cargo build --locked --all --no-default-features --features="$FEATURES"
41+
cargo test --locked --all --no-default-features --features="$FEATURES"
4242
# Single features
4343
for feature in ${FEATURES}
4444
do
45-
cargo build --all --no-default-features --features="$feature"
46-
cargo test --all --no-default-features --features="$feature"
45+
cargo build --locked --all --no-default-features --features="$feature"
46+
cargo test --locked --all --no-default-features --features="$feature"
4747
done
4848
# Features tested with 'std' feature enabled.
4949
for feature in ${FEATURES}
5050
do
51-
cargo build --all --no-default-features --features="std,$feature"
52-
cargo test --all --no-default-features --features="std,$feature"
51+
cargo build --locked --all --no-default-features --features="std,$feature"
52+
cargo test --locked --all --no-default-features --features="std,$feature"
5353
done
5454
# Other combos
55-
RUSTFLAGS='--cfg=secp256k1_fuzz' RUSTDOCFLAGS='--cfg=secp256k1_fuzz' cargo test --all
56-
RUSTFLAGS='--cfg=secp256k1_fuzz' RUSTDOCFLAGS='--cfg=secp256k1_fuzz' cargo test --all --features="$FEATURES"
57-
cargo test --all --features="rand serde"
55+
RUSTFLAGS='--cfg=secp256k1_fuzz' RUSTDOCFLAGS='--cfg=secp256k1_fuzz' cargo test --locked --all
56+
RUSTFLAGS='--cfg=secp256k1_fuzz' RUSTDOCFLAGS='--cfg=secp256k1_fuzz' cargo test --locked --all --features="$FEATURES"
57+
cargo test --locked --all --features="rand serde"
5858

5959
if [ "$NIGHTLY" = true ]; then
60-
cargo test --all --all-features
61-
RUSTFLAGS='--cfg=secp256k1_fuzz' RUSTDOCFLAGS='--cfg=secp256k1_fuzz' cargo test --all --all-features
60+
cargo test --locked --all --all-features
61+
RUSTFLAGS='--cfg=secp256k1_fuzz' RUSTDOCFLAGS='--cfg=secp256k1_fuzz' cargo test --locked --all --all-features
6262
fi
6363

6464
# Examples
65-
cargo run --example sign_verify --features=bitcoin-hashes-std
66-
cargo run --example sign_verify_recovery --features=recovery,bitcoin-hashes-std
67-
cargo run --example generate_keys --features=rand-std
65+
cargo run --locked --example sign_verify --features=bitcoin-hashes-std
66+
cargo run --locked --example sign_verify_recovery --features=recovery,bitcoin-hashes-std
67+
cargo run --locked --example generate_keys --features=rand-std
6868
fi
6969

7070
if [ "$DO_LINT" = true ]
7171
then
72-
cargo clippy --all-features --all-targets -- -D warnings
73-
cargo clippy --example sign_verify --features=bitcoin-hashes-std -- -D warnings
74-
cargo clippy --example sign_verify_recovery --features=recovery,bitcoin-hashes-std -- -D warnings
75-
cargo clippy --example generate_keys --features=rand-std -- -D warnings
72+
cargo clippy --locked --all-features --all-targets -- -D warnings
73+
cargo clippy --locked --example sign_verify --features=bitcoin-hashes-std -- -D warnings
74+
cargo clippy --locked --example sign_verify_recovery --features=recovery,bitcoin-hashes-std -- -D warnings
75+
cargo clippy --locked --example generate_keys --features=rand-std -- -D warnings
7676
fi
7777

7878
# Build the docs if told to (this only works with the nightly toolchain)

contrib/test.sh

+20-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
set -ex
44

55
REPO_DIR=$(git rev-parse --show-toplevel)
6+
DEPS="recent minimal"
67

78
# Webassembly stuff
89
#
@@ -18,4 +19,22 @@ if [ "$DO_WASM" = true ]; then
1819
exit 0
1920
fi
2021

21-
$REPO_DIR/contrib/_test.sh
22+
for dep in $DEPS
23+
do
24+
"Cargo-$dep.lock" Cargo.lock
25+
$REPO_DIR/contrib/_test.sh
26+
27+
if [ "$dep" = recent ];
28+
then
29+
# We always test committed dependencies but we want to warn if they could've been updated
30+
cargo update
31+
if diff Cargo-recent.lock Cargo.lock;
32+
then
33+
echo "Dependencies are up to date"
34+
else
35+
echo "::warning file=Cargo-recent.lock::Dependencies could be updated"
36+
fi
37+
fi
38+
done
39+
40+
exit 0

0 commit comments

Comments
 (0)