language: rust
rust: nightly-2019-11-04
before_script:
- export PATH="$PATH:$HOME/.cargo/bin"
install:
- rustup component add rustfmt
- rustup component add clippy
script:
- cargo fmt -- --version
- cargo fmt -- --check
- cargo clippy --all-features --
- ./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="