aboutsummaryrefslogtreecommitdiff
path: root/ci/script.sh
blob: b9f688696d1b7d44342421a397461a0541767e30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
set -ex

export CARGO_INCREMENTAL=0

FEATURES="async_smol async_tokio async_std async_futures"

if [ "$CLIPPY" = "yes" ]; then
      cargo clippy --all -- -D warnings
elif [ "$DOCS" = "yes" ]; then
    cargo clean
    cargo doc --features "$FEATURES" --all --no-deps
    cd book
    mdbook build
    cd ..
    cp -r book/book/html/ target/doc/book/
    travis-cargo doc-upload || true
elif [ "$RUSTFMT" = "yes" ]; then
    cargo fmt --all -- --check
elif [ "$MINIMAL_VERSIONS" = "yes" ]; then
    rm Cargo.lock || true
    cargo build -Z minimal-versions
else
    export RUSTFLAGS="-D warnings"

    cargo build --features "$FEATURES" $BUILD_ARGS

    cargo test --features "$FEATURES" --all
    cargo test --features "$FEATURES" --benches
    
    cd bencher_compat
    export CARGO_TARGET_DIR="../target"
    cargo test --benches
    cd ..

    if [ "$TRAVIS_RUST_VERSION" = "nightly" ]; then
        cd macro
        export CARGO_TARGET_DIR="../target"
        cargo test --benches
        cd ..
    fi
fi