serde/travis.sh
Oliver Schneider 368784949e move to cargo clippy instead of using the clippy plugin (#733)
* move to cargo clippy instead of using the clippy plugin

fixes #729

* non-exectable scripts must be run with `sh`

* don't build serde in the clippy travis job

* only run clippy tests if installing clippy succeeds

* why is travis so picky?

* no more serde_codegen

* serde_test_suite_deps has no features

* don't use empty loops, llvm optimizes them to undefined behaviour

* abort the clippy job when clippy lints are triggered

* use caches on travis to speed up builds

* why are we even using `travis-cargo`?

* need to reinstall clippy frequently due to nightly updates

* command line tools are hard
2017-01-31 09:09:37 -08:00

24 lines
1.2 KiB
Bash

#!/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)
else
echo "could not compile clippy, ignoring clippy tests"
fi
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