Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ci/rust-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export rust_nightly_docker_image=solanalabs/rust-nightly:"$nightly_version"

rustup_install() {
declare toolchain=$1
if ! cargo +"$toolchain" -V; then
if ! cargo +"$toolchain" -V > /dev/null; then
echo "$0: Missing toolchain? Installing...: $toolchain" >&2
rustup install "$toolchain"
cargo +"$toolchain" -V
fi
Expand All @@ -58,7 +59,7 @@ export rust_nightly_docker_image=solanalabs/rust-nightly:"$nightly_version"
rustup_install "$rust_nightly"
;;
*)
echo "Note: ignoring unknown argument: $1"
echo "$0: Note: ignoring unknown argument: $1" >&2
;;
esac
)
24 changes: 18 additions & 6 deletions ci/test-checks.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env bash
#
# cargo fmt, cargo clippy
#

set -e

cd "$(dirname "$0")/.."
Expand All @@ -10,6 +8,23 @@ source ci/_
source ci/rust-version.sh stable
source ci/rust-version.sh nightly

echo --- build environment
(
set -x

rustup run "$rust_stable" rustc --version --verbose
rustup run "$rust_nightly" rustc --version --verbose

cargo +"$rust_stable" --version --verbose
cargo +"$rust_nightly" --version --verbose

cargo +"$rust_stable" clippy --version --verbose
cargo +"$rust_nightly" clippy --version --verbose

# audit is done only with stable
cargo +"$rust_stable" audit --version
)

export RUST_BACKTRACE=1
export RUSTFLAGS="-D warnings"

Expand All @@ -26,10 +41,8 @@ _ ci/order-crates-for-publishing.py
_ cargo +"$rust_stable" fmt --all -- --check

# -Z... is needed because of clippy bug: https://github.com/rust-lang/rust-clippy/issues/4612
_ cargo +"$rust_nightly" clippy -Zunstable-options --version
_ cargo +"$rust_nightly" clippy -Zunstable-options --workspace --all-targets -- --deny=warnings

_ cargo +"$rust_stable" audit --version
_ scripts/cargo-for-all-lock-files.sh +"$rust_stable" audit --ignore RUSTSEC-2020-0002 --ignore RUSTSEC-2020-0008

{
Expand All @@ -41,7 +54,6 @@ _ scripts/cargo-for-all-lock-files.sh +"$rust_stable" audit --ignore RUSTSEC-202
cd "$project"
_ cargo +"$rust_stable" fmt -- --check
_ cargo +"$rust_nightly" test
_ cargo +"$rust_nightly" clippy --version
_ cargo +"$rust_nightly" clippy -- --deny=warnings --allow=clippy::missing_safety_doc
)
done
Expand Down