@@ -32,13 +32,12 @@ install:
32
32
if ! rustup component add rustfmt; then
33
33
cargo install -Z install-upgrade --git https://github.com/rust-lang/rustfmt --bin rustfmt
34
34
fi
35
- if [ "$TRAVIS_OS_NAME" == " linux" ]; then
35
+ if [[ "$TRAVIS_OS_NAME" == linux ] ]; then
36
36
. $HOME/.nvm/nvm.sh
37
37
nvm install stable
38
38
nvm use stable
39
39
npm install remark-cli remark-lint
40
- fi
41
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then
40
+ elif [[ "$TRAVIS_OS_NAME" == windows ]]; then
42
41
choco install windows-sdk-10.1
43
42
fi
44
43
fi
@@ -102,39 +101,44 @@ matrix:
102
101
103
102
script :
104
103
- |
105
- if [ "$TRAVIS_BRANCH" == "auto" ] || [ "$TRAVIS_BRANCH" == "try" ]; then
106
- pr =$(echo $TRAVIS_COMMIT_MESSAGE | grep -o "#[0-9]*" | head -1 | sed 's/^#//g')
107
- output=$(curl -H "Authorization: token $GITHUB_API_TOKEN" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$pr " | \
104
+ if [[ "$TRAVIS_BRANCH" == "auto" ]] || [[ "$TRAVIS_BRANCH" == "try" ] ]; then
105
+ PR =$(echo " $TRAVIS_COMMIT_MESSAGE" | grep -o "#[0-9]*" | head -1 | sed 's/^#//g')
106
+ output=$(curl -H "Authorization: token $GITHUB_API_TOKEN" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR " | \
108
107
python -c "import sys, json; print(json.load(sys.stdin)['body'])" | \
109
108
grep "^changelog: " | \
110
109
sed "s/changelog: //g")
111
- if [ -z "$output" ]; then
110
+ if [[ -z "$output" ] ]; then
112
111
echo "ERROR: PR body must contain 'changelog: ...'"
113
112
exit 1
114
- elif [ "$output" = "none" ]; then
113
+ elif [[ "$output" = "none" ] ]; then
115
114
echo "WARNING: changelog is 'none'"
116
115
fi
117
116
fi
118
117
- |
119
- rm rust-toolchain
120
- ./setup-toolchain.sh
121
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then
122
- export PATH=$PATH:$(rustc --print sysroot)/bin
123
- else
124
- export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib
125
- fi
118
+ set -e
119
+ rm rust-toolchain
120
+ ./setup-toolchain.sh
121
+ if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
122
+ export PATH=$PATH:$(rustc --print sysroot)/bin
123
+ else
124
+ export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib
125
+ fi
126
+ set +e
126
127
- |
127
- if [ -z ${INTEGRATION} ]; then
128
+ if [[ -z ${INTEGRATION} ] ]; then
128
129
travis_wait 30 ./ci/base-tests.sh && sleep 5
129
130
else
130
131
./ci/integration-tests.sh && sleep 5
131
132
fi
132
133
133
- after_success : |
134
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
135
- if [ -z ${INTEGRATION} ]; then
136
- ./.github/deploy.sh
137
- else
138
- echo "Not deploying, because we're in an integration test run"
134
+ after_success :
135
+ - |
136
+ if [ "$TRAVIS_OS_NAME" == "linux" ]; then
137
+ if [[ -z ${INTEGRATION} ]]; then
138
+ set -e
139
+ ./.github/deploy.sh
140
+ set +e
141
+ else
142
+ echo "Not deploying, because we're in an integration test run"
143
+ fi
139
144
fi
140
- fi
0 commit comments