8 # Don't build these branches
18 - cargo install cargo-cache --debug
19 - find $HOME/.cargo/bin/ ! -type d -exec strip {} \;
20 - cargo cache --autoclean
25 - secure: "OKulfkA5OGd/d1IhvBKzRkHQwMcWjzrzbimo7+5NhkUkWxndAzl+719TB3wWvIh1i2wXXrEXsyZkXM5FtRrHm55v1VKQ5ibjEvFg1w3NIg81iDyoLq186fLqywvxGkOAFPrsePPsBj5USd5xvhwwbrjO6L7/RK6Z8shBwOSc41s="
28 - export CARGO_TARGET_DIR="$TRAVIS_BUILD_DIR/target"
30 case "$TRAVIS_OS_NAME" in
31 linux ) HOST=x86_64-unknown-linux-gnu;;
32 osx ) HOST=x86_64-apple-darwin;;
33 windows ) HOST=x86_64-pc-windows-msvc;;
35 - curl -sSL https://sh.rustup.rs | sh -s -- -y --default-host="$HOST" --default-toolchain=nightly --profile=minimal
36 - export PATH="$HOME/.cargo/bin:$PATH"
39 if [[ -z ${INTEGRATION} ]]; then
40 if ! rustup component add rustfmt; then
41 TARGET=$(rustc -Vv | awk '/host/{print $2}')
42 NIGHTLY=$(curl -s "https://rust-lang.github.io/rustup-components-history/${TARGET}/rustfmt")
43 curl -sSL "https://static.rust-lang.org/dist/${NIGHTLY}/rustfmt-nightly-${TARGET}.tar.xz" | \
44 tar -xJf - --strip-components=3 -C ~/.cargo/bin
45 rm -rf ~/.cargo/bin/doc
47 if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
51 npm install remark-cli remark-lint remark-lint-maximum-line-length remark-preset-lint-recommended
52 elif [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
53 choco install windows-sdk-10.1
57 # disabling the integration tests in forks should be done with
59 # but this is currently buggy travis-ci/travis-ci#9118
63 # Builds that are executed for every PR
65 # i686 toolchain could run on x86_64 system.
67 env: HOST_TOOLCHAIN=i686-unknown-linux-gnu
72 - libssl-dev:i386 # openssl dev in Cargo.toml
73 if: branch IN (auto, try)
75 env: CARGO_INCREMENTAL=0 OS_WINDOWS=true
77 # Builds that are only executed when a PR is r+ed or a try build is started
78 # We don't want to run these always because they go towards
79 # the build limit within the Travis rust-lang account.
80 # The jobs are approximately sorted by execution time
82 if: branch IN (auto, try)
83 - env: INTEGRATION=rust-lang/rls
84 if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
85 - env: INTEGRATION=rust-lang/cargo
86 if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
87 - env: INTEGRATION=rust-lang/chalk
88 if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
89 - env: INTEGRATION=Geal/nom
90 if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
91 - env: INTEGRATION=rust-lang/rustfmt
92 if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
93 - env: INTEGRATION=hyperium/hyper
94 if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
95 - env: INTEGRATION=rust-itertools/itertools
96 if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
97 # FIXME: rustc ICE on `serde_test_suite`
98 # - env: INTEGRATION=serde-rs/serde
99 # if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
100 - env: INTEGRATION=rust-lang/stdarch
101 if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
102 - env: INTEGRATION=rust-random/rand
103 if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
104 - env: INTEGRATION=rust-lang/futures-rs
105 if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
106 - env: INTEGRATION=Marwes/combine
107 if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
108 - env: INTEGRATION=rust-lang-nursery/failure
109 if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
110 - env: INTEGRATION=rust-lang/log
111 if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
112 - env: INTEGRATION=chronotope/chrono
113 if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
116 env: CARGO_INCREMENTAL=0 OS_WINDOWS=true
120 if [[ "$TRAVIS_BRANCH" == "auto" ]] || [[ "$TRAVIS_BRANCH" == "try" ]]; then
121 PR=$(echo "$TRAVIS_COMMIT_MESSAGE" | grep -o "#[0-9]*" | head -1 | sed 's/^#//g')
122 output=$(curl -H "Authorization: token $GITHUB_API_TOKEN" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR" | \
123 python -c "import sys, json; print(json.load(sys.stdin)['body'])" | \
124 grep "^changelog: " | \
125 sed "s/changelog: //g")
126 if [[ -z "$output" ]]; then
127 echo "ERROR: PR body must contain 'changelog: ...'"
129 elif [[ "$output" = "none" ]]; then
130 echo "WARNING: changelog is 'none'"
137 SYSROOT=$(rustc --print sysroot)
138 case "$TRAVIS_OS_NAME" in
139 windows ) export PATH="${SYSROOT}/bin:${PATH}" ;;
140 linux ) export LD_LIBRARY_PATH="${SYSROOT}/lib${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}}" ;;
142 # See <https://github.com/nteract/nteract/issues/1523#issuecomment-301623519>
143 sudo mkdir -p /usr/local/lib
144 sudo find "$SYSROOT/lib" -maxdepth 1 -name '*.dylib' -exec ln -s {} /usr/local/lib \;
150 if [[ -n ${INTEGRATION} ]]; then
151 cargo test --test integration --features integration && sleep 5
153 ./ci/base-tests.sh && sleep 5