diff --git a/.travis.yml b/.travis.yml index 077a17e0bac..77dc8fc4b19 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,23 +29,21 @@ install: - nvm use stable - npm install remark-cli remark-lint +matrix: + include: + - env: INTEGRATION=rust-lang/cargo + - env: INTEGRATION=rust-lang-nursery/rand + allow_failures: + - env: INTEGRATION=rust-lang/cargo + - env: INTEGRATION=rust-lang-nursery/rand + script: - - PATH=$PATH:./node_modules/.bin - - remark -f *.md > /dev/null - - set -e - - cargo build --features debugging - - cargo test --features debugging - - mkdir -p ~/rust/cargo/bin - - cp target/debug/cargo-clippy ~/rust/cargo/bin/cargo-clippy - - cp target/debug/clippy-driver ~/rust/cargo/bin/clippy-driver - - PATH=$PATH:~/rust/cargo/bin cargo clippy --all -- -D clippy - - cd clippy_workspace_tests && PATH=$PATH:~/rust/cargo/bin cargo clippy -- -D clippy && cd .. - - cd clippy_workspace_tests/src && PATH=$PATH:~/rust/cargo/bin cargo clippy -- -D clippy && cd ../.. - - cd clippy_workspace_tests/subcrate && PATH=$PATH:~/rust/cargo/bin cargo clippy -- -D clippy && cd ../.. - - cd clippy_workspace_tests/subcrate/src && PATH=$PATH:~/rust/cargo/bin cargo clippy -- -D clippy && cd ../../.. - - PATH=$PATH:~/rust/cargo/bin cargo clippy --manifest-path=clippy_workspace_tests/Cargo.toml -- -D clippy - - cd clippy_workspace_tests/subcrate && PATH=$PATH:~/rust/cargo/bin cargo clippy --manifest-path=../Cargo.toml -- -D clippy && cd ../.. - - set +e + - | + if [ -z ${INTEGRATION} ]; then + ./ci/base-tests.sh + else + ./ci/integration-tests.sh + fi after_success: | #!/bin/bash diff --git a/ci/base-tests.sh b/ci/base-tests.sh new file mode 100644 index 00000000000..fc01ce05b3b --- /dev/null +++ b/ci/base-tests.sh @@ -0,0 +1,15 @@ +PATH=$PATH:./node_modules/.bin +remark -f *.md > /dev/null +set -e +cargo build --features debugging +cargo test --features debugging +mkdir -p ~/rust/cargo/bin +cp target/debug/cargo-clippy ~/rust/cargo/bin/cargo-clippy +cp target/debug/clippy-driver ~/rust/cargo/bin/clippy-driver +PATH=$PATH:~/rust/cargo/bin cargo clippy --all -- -D clippy +cd clippy_workspace_tests && PATH=$PATH:~/rust/cargo/bin cargo clippy -- -D clippy && cd .. +cd clippy_workspace_tests/src && PATH=$PATH:~/rust/cargo/bin cargo clippy -- -D clippy && cd ../.. +cd clippy_workspace_tests/subcrate && PATH=$PATH:~/rust/cargo/bin cargo clippy -- -D clippy && cd ../.. +cd clippy_workspace_tests/subcrate/src && PATH=$PATH:~/rust/cargo/bin cargo clippy -- -D clippy && cd ../../.. +PATH=$PATH:~/rust/cargo/bin cargo clippy --manifest-path=clippy_workspace_tests/Cargo.toml -- -D clippy +cd clippy_workspace_tests/subcrate && PATH=$PATH:~/rust/cargo/bin cargo clippy --manifest-path=../Cargo.toml -- -D clippy && cd ../.. diff --git a/ci/integration-tests.sh b/ci/integration-tests.sh new file mode 100755 index 00000000000..c6c2a4a4d58 --- /dev/null +++ b/ci/integration-tests.sh @@ -0,0 +1,24 @@ +cargo install --force + +echo "Running integration test for crate ${INTEGRATION}" + +git clone https://github.com/${INTEGRATION}.git + +function check() { + cargo clippy --all &> clippy_output + cat clippy_output + ! cat clippy_output | grep -q "internal error" + if [[ $? != 0 ]]; then + return 1 + fi +} + +case ${INTEGRATION} in + rust-lang/cargo) + check + ;; + *) + cd ${INTEGRATION} + check + ;; +esac