1
1
dist : xenial
2
2
language : bash
3
3
4
- os :
5
- - linux
6
- - osx
7
- - windows
8
-
9
4
branches :
10
5
# Don't build these branches
11
6
except :
@@ -34,13 +29,12 @@ install:
34
29
if ! rustup component add rustfmt; then
35
30
cargo install -Z install-upgrade --git https://github.com/rust-lang/rustfmt --bin rustfmt
36
31
fi
37
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
32
+ if [[ "$TRAVIS_OS_NAME" == "linux" ] ]; then
38
33
. $HOME/.nvm/nvm.sh
39
34
nvm install stable
40
35
nvm use stable
41
36
npm install remark-cli remark-lint
42
- fi
43
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then
37
+ elif [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
44
38
choco install windows-sdk-10.1
45
39
fi
46
40
fi
@@ -53,11 +47,9 @@ matrix:
53
47
include :
54
48
# Builds that are executed for every PR
55
49
- os : osx # run base tests on both platforms
56
- env : BASE_TESTS=true
57
50
- os : linux
58
- env : BASE_TESTS=true
59
51
- os : windows
60
- env : CARGO_INCREMENTAL=0 BASE_TESTS=true OS_WINDOWS=true
52
+ env : CARGO_INCREMENTAL=0 OS_WINDOWS=true
61
53
62
54
# Builds that are only executed when a PR is r+ed or a try build is started
63
55
# We don't want to run these always because they go towards
@@ -95,51 +87,51 @@ matrix:
95
87
if : repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
96
88
allow_failures :
97
89
- 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
104
91
105
92
before_script :
106
93
- |
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 " | \
110
97
python -c "import sys, json; print(json.load(sys.stdin)['body'])" | \
111
98
grep "^changelog: " | \
112
99
sed "s/changelog: //g")
113
- if [ -z "$output" ]; then
100
+ if [[ -z "$output" ] ]; then
114
101
echo "ERROR: PR body must contain 'changelog: ...'"
115
102
exit 1
116
- elif [ "$output" = "none" ]; then
103
+ elif [[ "$output" = "none" ] ]; then
117
104
echo "WARNING: changelog is 'none'"
118
105
fi
119
106
fi
120
107
- |
121
108
rm rust-toolchain
122
109
./setup-toolchain.sh
123
110
- |
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
129
121
130
122
script :
131
123
- |
132
- if [ -z ${INTEGRATION} ]; then
133
- travis_wait 30 ./ci/base-tests.sh && sleep 5
134
- else
124
+ if [[ -n ${INTEGRATION} ]]; then
135
125
./ci/integration-tests.sh && sleep 5
126
+ else
127
+ ./ci/base-tests.sh && sleep 5
136
128
fi
137
129
138
130
after_success :
139
131
- |
140
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
132
+ if [[ "$TRAVIS_OS_NAME" == "linux" ] ]; then
141
133
set -e
142
- if [ -z ${INTEGRATION} ]; then
134
+ if [[ -z ${INTEGRATION} ] ]; then
143
135
./.github/deploy.sh
144
136
else
145
137
echo "Not deploying, because we're in an integration test run"
0 commit comments