add toolchain and build/check shortcut to smoketest

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-05-27 08:26:48 +00:00 committed by June 🍓🦴
parent 25f598ce6c
commit ec7a9ab726

View file

@ -28,28 +28,34 @@ conduwuit () {
} }
element () { element () {
TOOLCHAIN=$1; shift
ELEMENT_OPTS=$@ ELEMENT_OPTS=$@
run cargo check $ELEMENT_OPTS --all-targets run cargo "$TOOLCHAIN" check $ELEMENT_OPTS --all-targets
run cargo clippy $ELEMENT_OPTS --all-targets -- -D warnings run cargo "$TOOLCHAIN" clippy $ELEMENT_OPTS --all-targets -- -D warnings
run cargo build $ELEMENT_OPTS --all-targets if [ "$BUILD" != "check" ]; then
run cargo test $ELEMENT_OPTS --all-targets run cargo "$TOOLCHAIN" build $ELEMENT_OPTS --all-targets
run cargo bench $ELEMENT_OPTS --all-targets run cargo "$TOOLCHAIN" test $ELEMENT_OPTS --all-targets
run cargo run $ELEMENT_OPTS --bin conduit -- -V run cargo "$TOOLCHAIN" bench $ELEMENT_OPTS --all-targets
run conduwuit $ELEMENT_OPTS --bin conduit run cargo "$TOOLCHAIN" run $ELEMENT_OPTS --bin conduit -- -V
run conduwuit $ELEMENT_OPTS --bin conduit
fi
} }
vector () { vector () {
TOOLCHAIN=$1; shift
VECTOR_OPTS=$@ VECTOR_OPTS=$@
element $VECTOR_OPTS --no-default-features --features="rocksdb" element "$TOOLCHAIN" $VECTOR_OPTS --no-default-features --features="rocksdb"
element $VECTOR_OPTS --features=default element "$TOOLCHAIN" $VECTOR_OPTS --features=default
element $VECTOR_OPTS --all-features element "$TOOLCHAIN" $VECTOR_OPTS --all-features
} }
matrix () { matrix () {
run cargo fmt --all --check run cargo +nightly fmt --all --check
vector --profile=dev vector +nightly --profile=dev
vector --profile=release vector +nightly --profile=release
vector "" --profile=dev
vector "" --profile=release
} }
matrix && BUILD=${1:-build}
exit 0 matrix && exit 0