mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-13 11:21:01 +00:00
Allow running travis build locally
This commit is contained in:
@@ -1,24 +1,70 @@
|
||||
#!/bin/bash
|
||||
set -ev
|
||||
if [ "${CLIPPY}" = "true" ]; then
|
||||
if cargo install clippy -f; then
|
||||
(cd serde && cargo clippy --features unstable-testing -- -Dclippy)
|
||||
(cd serde_derive && cargo clippy --features unstable-testing -- -Dclippy)
|
||||
(cd test_suite && cargo clippy --features unstable-testing -- -Dclippy)
|
||||
(cd test_suite/deps && cargo clippy -- -Dclippy)
|
||||
(cd test_suite/no_std && cargo clippy -- -Dclippy)
|
||||
|
||||
set -e
|
||||
|
||||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
channel() {
|
||||
if [ -n "${TRAVIS}" ]; then
|
||||
if [ "${TRAVIS_RUST_VERSION}" = "${CHANNEL}" ]; then
|
||||
pwd
|
||||
(set -x; cargo "$@")
|
||||
fi
|
||||
else
|
||||
echo "could not compile clippy, ignoring clippy tests"
|
||||
pwd
|
||||
(set -x; cargo "+${CHANNEL}" "$@")
|
||||
fi
|
||||
}
|
||||
|
||||
if [ -n "${CLIPPY}" ]; then
|
||||
if [ -n "${TRAVIS}" ]; then
|
||||
# cached installation will not work on a later nightly
|
||||
cargo install clippy --force
|
||||
fi
|
||||
|
||||
cd "$DIR/serde"
|
||||
cargo clippy --features unstable-testing -- -Dclippy
|
||||
|
||||
cd "$DIR/serde_derive"
|
||||
cargo clippy --features unstable-testing -- -Dclippy
|
||||
|
||||
cd "$DIR/test_suite"
|
||||
cargo clippy --features unstable-testing -- -Dclippy
|
||||
|
||||
cd "$DIR/test_suite/no_std"
|
||||
cargo clippy -- -Dclippy
|
||||
else
|
||||
(cd serde && travis-cargo build)
|
||||
(cd serde && travis-cargo --only beta test)
|
||||
(cd serde && travis-cargo --only nightly test -- --features unstable-testing)
|
||||
(cd serde && travis-cargo build -- --no-default-features)
|
||||
(cd serde && travis-cargo --only nightly build -- --no-default-features --features alloc)
|
||||
(cd serde && travis-cargo --only nightly build -- --no-default-features --features collections)
|
||||
(cd test_suite && travis-cargo --only beta test)
|
||||
(cd test_suite/deps && travis-cargo --only nightly build)
|
||||
(cd test_suite travis-cargo --only nightly test -- --features unstable-testing)
|
||||
(cd test_suite/no_std && travis-cargo --only nightly build)
|
||||
fi
|
||||
CHANNEL=nightly
|
||||
cargo clean
|
||||
cd "$DIR/serde"
|
||||
channel build
|
||||
channel build --no-default-features
|
||||
channel build --no-default-features --features alloc
|
||||
channel build --no-default-features --features collections
|
||||
channel test --features unstable-testing
|
||||
cd "$DIR/test_suite/deps"
|
||||
channel build
|
||||
cd "$DIR/test_suite"
|
||||
channel test --features unstable-testing
|
||||
cd "$DIR/test_suite/no_std"
|
||||
channel build
|
||||
|
||||
CHANNEL=beta
|
||||
cargo clean
|
||||
cd "$DIR/serde"
|
||||
channel build
|
||||
cd "$DIR/test_suite"
|
||||
channel test
|
||||
|
||||
CHANNEL=stable
|
||||
cargo clean
|
||||
cd "$DIR/serde"
|
||||
channel build
|
||||
channel build --no-default-features
|
||||
|
||||
CHANNEL=1.13.0
|
||||
cargo clean
|
||||
cd "$DIR/serde"
|
||||
channel build
|
||||
channel build --no-default-features
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user