Skip to content

Commit e74230a

Browse files
committed
only run clippy on MSRV when in CI mode
1 parent 254ecd9 commit e74230a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ categories = ["cryptography"]
1111
readme = "README.md"
1212
keywords = ["noise", "protocol", "crypto"]
1313
edition = "2021"
14-
rust-version = "1.81"
14+
rust-version = "1.81.0"
1515

1616
# This is slightly mumbo-jumboey, but in short:
1717
# Features with a -resolver suffix simply enables the existence of a specific resolver,

ci-tests.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env bash
22
set -e
33
TARGET="$([ -n "$1" ] && echo "--target $1" || echo "")"
4+
MSRV="$(cargo metadata --no-deps | jq -r .packages[0].rust_version)"
5+
RUSTC_VERSION="$(rustc --version | cut -w -f2)"
46

57
COMMON_FEATURES="use-p256 use-xchacha20poly1305 vector-tests"
68
if ! rustc -vV | grep 'host: .*windows' &> /dev/null; then
@@ -9,7 +11,11 @@ fi
911

1012
set -x
1113
cargo check --benches --tests --examples
12-
cargo clippy --features "$COMMON_FEATURES" --tests --benches --examples -- -Dwarnings
14+
if [[ "$CI" != "true" || "$RUSTC_VERSION" == "$MSRV" ]]; then
15+
cargo clippy --features "$COMMON_FEATURES" --tests --benches --examples -- -Dwarnings
16+
else
17+
echo "skipping cargo clippy on non-MSRV CI run. MSRV: $MSRV, rustc: $RUSTC_VERSION"
18+
fi
1319
cargo test $TARGET --no-default-features
1420
# Custom set of crypto without std
1521
cargo test $TARGET --no-default-features --features "default-resolver use-curve25519 use-blake2 use-chacha20poly1305"

0 commit comments

Comments
 (0)