11dist : xenial
22language : bash
33
4- os :
5- - linux
6- - osx
7- - windows
8-
94branches :
105 # Don't build these branches
116 except :
@@ -34,13 +29,12 @@ install:
3429 if ! rustup component add rustfmt; then
3530 cargo install -Z install-upgrade --git https://github.com/rust-lang/rustfmt --bin rustfmt
3631 fi
37- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
32+ if [[ "$TRAVIS_OS_NAME" == "linux" ] ]; then
3833 . $HOME/.nvm/nvm.sh
3934 nvm install stable
4035 nvm use stable
4136 npm install remark-cli remark-lint
42- fi
43- if [ "$TRAVIS_OS_NAME" == "windows" ]; then
37+ elif [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
4438 choco install windows-sdk-10.1
4539 fi
4640 fi
@@ -53,11 +47,9 @@ matrix:
5347 include :
5448 # Builds that are executed for every PR
5549 - os : osx # run base tests on both platforms
56- env : BASE_TESTS=true
5750 - os : linux
58- env : BASE_TESTS=true
5951 - os : windows
60- env : CARGO_INCREMENTAL=0 BASE_TESTS=true OS_WINDOWS=true
52+ env : CARGO_INCREMENTAL=0 OS_WINDOWS=true
6153
6254 # Builds that are only executed when a PR is r+ed or a try build is started
6355 # We don't want to run these always because they go towards
@@ -95,51 +87,51 @@ matrix:
9587 if : repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
9688 allow_failures :
9789 - os : windows
98- env : CARGO_INCREMENTAL=0 BASE_TESTS=true OS_WINDOWS=true
99- # prevent these jobs with default env vars
100- exclude :
101- - os : linux
102- - os : osx
103- - os : windows
90+ env : CARGO_INCREMENTAL=0 OS_WINDOWS=true
10491
10592before_script :
10693 - |
107- if [ "$TRAVIS_BRANCH" == "auto" ] || [ "$TRAVIS_BRANCH" == "try" ]; then
108- pr =$(echo $TRAVIS_COMMIT_MESSAGE | grep -o "#[0-9]*" | head -1 | sed 's/^#//g')
109- output=$(curl -H "Authorization: token $GITHUB_API_TOKEN" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$pr " | \
94+ if [[ "$TRAVIS_BRANCH" == "auto" ]] || [[ "$TRAVIS_BRANCH" == "try" ] ]; then
95+ PR =$(echo " $TRAVIS_COMMIT_MESSAGE" | grep -o "#[0-9]*" | head -1 | sed 's/^#//g')
96+ output=$(curl -H "Authorization: token $GITHUB_API_TOKEN" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR " | \
11097 python -c "import sys, json; print(json.load(sys.stdin)['body'])" | \
11198 grep "^changelog: " | \
11299 sed "s/changelog: //g")
113- if [ -z "$output" ]; then
100+ if [[ -z "$output" ] ]; then
114101 echo "ERROR: PR body must contain 'changelog: ...'"
115102 exit 1
116- elif [ "$output" = "none" ]; then
103+ elif [[ "$output" = "none" ] ]; then
117104 echo "WARNING: changelog is 'none'"
118105 fi
119106 fi
120107 - |
121108 rm rust-toolchain
122109 ./setup-toolchain.sh
123110 - |
124- if [ "$TRAVIS_OS_NAME" == "windows" ]; then
125- export PATH=$PATH:$(rustc --print sysroot)/bin
126- else
127- export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib
128- fi
111+ SYSROOT=$(rustc --print sysroot)
112+ case "$TRAVIS_OS_NAME" in
113+ windows ) export PATH="${SYSROOT}/bin:${PATH}" ;;
114+ linux ) export LD_LIBRARY_PATH="${SYSROOT}/lib" ;;
115+ osx )
116+ # See <https://github.com/nteract/nteract/issues/1523#issuecomment-301623519>
117+ sudo mkdir -p /usr/local/lib
118+ sudo find "$SYSROOT/lib" -maxdepth 1 -name '*.dylib' -exec ln -s {} /usr/local/lib \;
119+ ;;
120+ esac
129121
130122script :
131123 - |
132- if [ -z ${INTEGRATION} ]; then
133- travis_wait 30 ./ci/base-tests.sh && sleep 5
134- else
124+ if [[ -n ${INTEGRATION} ]]; then
135125 ./ci/integration-tests.sh && sleep 5
126+ else
127+ ./ci/base-tests.sh && sleep 5
136128 fi
137129
138130after_success :
139131 - |
140- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
132+ if [[ "$TRAVIS_OS_NAME" == "linux" ] ]; then
141133 set -e
142- if [ -z ${INTEGRATION} ]; then
134+ if [[ -z ${INTEGRATION} ] ]; then
143135 ./.github/deploy.sh
144136 else
145137 echo "Not deploying, because we're in an integration test run"
0 commit comments