summaryrefslogtreecommitdiffstats
path: root/third_party/rust/bytes/ci/test-stable.sh
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/bytes/ci/test-stable.sh')
-rw-r--r--third_party/rust/bytes/ci/test-stable.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/third_party/rust/bytes/ci/test-stable.sh b/third_party/rust/bytes/ci/test-stable.sh
new file mode 100644
index 0000000000..4421f3a979
--- /dev/null
+++ b/third_party/rust/bytes/ci/test-stable.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+set -ex
+
+cmd="${1:-test}"
+
+# Install cargo-hack for feature flag test
+host=$(rustc -Vv | grep host | sed 's/host: //')
+curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-$host.tar.gz | tar xzf - -C ~/.cargo/bin
+
+# Run with each feature
+# * --each-feature includes both default/no-default features
+# * --optional-deps is needed for serde feature
+cargo hack "${cmd}" --each-feature --optional-deps
+# Run with all features
+cargo "${cmd}" --all-features
+
+cargo doc --no-deps --all-features
+
+if [[ "${RUST_VERSION}" == "nightly"* ]]; then
+ # Check benchmarks
+ cargo check --benches
+
+ # Check minimal versions
+ cargo clean
+ cargo update -Zminimal-versions
+ cargo check --all-features
+fi