language: rust
script:
cargo build --verbose && cargo test --verbose && cargo doc
rust:
- stable
- beta
- nightly
matrix:
allow_failures:
- rust: nightly
after_success: |
set -e
. ./scripts/travis-doc-upload.cfg
[ "$TRAVIS_BRANCH" = master ]
[ "$TRAVIS_PULL_REQUEST" = false ]
# we only want to push stable versions of docs
if [ "$TRAVIS_RUST_VERSION" != "stable" ]
then
echo "Skipping doc step: rust version is $TRAVIS_RUST_VERSION"
exit 0
fi
echo "Proceeding with doc step: rust version is $TRAVIS_RUST_VERSION"
eval key=\$encrypted_${SSH_KEY_TRAVIS_ID}_key
eval iv=\$encrypted_${SSH_KEY_TRAVIS_ID}_iv
mkdir -p ~/.ssh
openssl aes-256-cbc -K $key -iv $iv -in scripts/id_rsa.enc -out ~/.ssh/id_rsa -d
chmod 600 ~/.ssh/id_rsa
git clone --branch gh-pages git@github.com:$DOCS_REPO deploy_docs
cd deploy_docs
git config user.name "doc upload bot"
git config user.email "nobody@example.com"
rm -rf $PROJECT_NAME
mv ../target/doc $PROJECT_NAME
git add -A $PROJECT_NAME
git commit -qm "doc upload for $PROJECT_NAME ($TRAVIS_REPO_SLUG)"
git push -q origin gh-pages