Debian Codegraph @

third_party/rust/bytes/ci/test-stable.sh

raw
1 #!/bin/bash
2
3 set -ex
4
5 cmd="${1:-test}"
6
7 # Install cargo-hack for feature flag test
8 host=$(rustc -Vv | grep host | sed 's/host: //')
9 curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-$host.tar.gz | tar xzf - -C ~/.cargo/bin
10
11 # Run with each feature
12 # * --each-feature includes both default/no-default features
13 # * --optional-deps is needed for serde feature
14 cargo hack "${cmd}" --each-feature --optional-deps
15 # Run with all features
16 cargo "${cmd}" --all-features
17
18 cargo doc --no-deps --all-features
19
20 if [[ "${RUST_VERSION}" == "nightly"* ]]; then
21 # Check benchmarks
22 cargo check --benches
23
24 # Check minimal versions
25 cargo clean
26 cargo update -Zminimal-versions
27 cargo check --all-features
28 fi