forked from websockets-rs/rust-websocket
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
39 lines (36 loc) · 1.96 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
language: rust
rust: nightly
before_script:
- export PATH="$PATH:$HOME/.cargo/bin"
- which rustfmt || cargo install --vers 0.8.4 rustfmt
script:
- cargo fmt -- --write-mode=diff
- ./scripts/build-all.sh
- cargo test --features nightly
- cargo bench --features nightly
after_success:
- sudo apt-get install python-unittest2
- sudo pip install ghp-import urllib3[secure] autobahntestsuite
- echo "Running Autobahn TestSuite for client" && ./scripts/autobahn-client.sh
- echo "Running Autobahn TestSuite for server" && ./scripts/autobahn-server.sh
- >
[ $TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ] && {
echo "Building docs and gh-pages" ;
PROJECT_VERSION=$(cargo doc --features nightly | grep "Documenting websocket v" | sed 's/.*Documenting websocket v\(.*\) .*/\1/') ;
curl -sL https://github.com/${TRAVIS_REPO_SLUG}/archive/html.tar.gz | tar xz ;
cd ./rust-websocket-html &&
find . -type f | xargs sed -i 's/<!--VERSION-->/'"${PROJECT_VERSION}"'/g' ;
mv ../target/doc ./doc ;
mv ../autobahn/server ./autobahn/server ;
mv ../autobahn/client ./autobahn/client ;
mv ./autobahn/server/index.json ./autobahn/server/index.temp && rm ./autobahn/server/*.json && mv ./autobahn/server/index.temp ./autobahn/server/index.json ;
mv ./autobahn/client/index.json ./autobahn/client/index.temp && rm ./autobahn/client/*.json && mv ./autobahn/client/index.temp ./autobahn/client/index.json ;
cd ../ ; }
- >
[ $TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ] && {
echo "Pushing gh-pages" ;
ghp-import -n ./rust-websocket-html -m "Generated by Travis CI build ${TRAVIS_BUILD_NUMBER} for commit ${TRAVIS_COMMIT}" &&
git push -fq https://${TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages ; }
env:
global:
secure: "g79arUER26fJvQu5/e/KvPl8jgnOv+LYD64x0PEZzRY7x+Bo0F45gjDTUG40AEdeh4upxT6twnSo6y+/v8V71NY0b+lPM2q3pS4KicQaDSLfigR1ogMo5A+Iv6l3shRFJhMiDapO3OlcvI2i+U6Er7sUcqIkZaUbbohGI1/0DtE="