Use scripts for compound travis commands

This commit is contained in:
Josh Stone 2015-11-18 21:33:07 -08:00
parent e41016975f
commit 658637dcba
5 changed files with 32 additions and 17 deletions

View File

@ -7,28 +7,14 @@ sudo: false
script: script:
- cargo build --verbose - cargo build --verbose
- cargo test --verbose - cargo test --verbose
- | - .travis/test_features.sh
(for feature in '' bigint rational complex; do - [ $TRAVIS_RUST_VERSION = nightly ] .travis/test_nightly.sh
cargo test --verbose --no-default-features --features="$feature" || exit 1
done)
- |
[ $TRAVIS_RUST_VERSION != nightly ] || (
cargo bench &&
cargo test --verbose --manifest-path=num-macros/Cargo.toml
)
- cargo doc - cargo doc
after_success: | after_success: |
[ $TRAVIS_BRANCH = master ] && [ $TRAVIS_BRANCH = master ] &&
[ $TRAVIS_PULL_REQUEST = false ] && [ $TRAVIS_PULL_REQUEST = false ] &&
[ $TRAVIS_RUST_VERSION = nightly ] && [ $TRAVIS_RUST_VERSION = nightly ] &&
openssl aes-256-cbc -K $encrypted_9e86330b283d_key -iv $encrypted_9e86330b283d_iv -in .travis/deploy.enc -out .travis/deploy -d && ssh-agent .travis/deploy.sh
chmod 600 .travis/deploy &&
eval "$(ssh-agent -s)" &&
ssh-add .travis/deploy &&
pip install ghp-import --user $USER &&
cp doc/* target/doc/ &&
$HOME/.local/bin/ghp-import -n target/doc &&
git push -qf ssh://git@github.com/${TRAVIS_REPO_SLUG}.git gh-pages
notifications: notifications:
email: email:
on_success: never on_success: never

1
.travis/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/deploy

12
.travis/deploy.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
set -ex
cp doc/* target/doc/
pip install ghp-import --user
$HOME/.local/bin/ghp-import -n target/doc
openssl aes-256-cbc -K $encrypted_9e86330b283d_key -iv $encrypted_9e86330b283d_iv -in .travis/deploy.enc -out .travis/deploy -d
chmod 600 .travis/deploy
ssh-add .travis/deploy
git push -qf ssh://git@github.com/${TRAVIS_REPO_SLUG}.git gh-pages

9
.travis/test_features.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
set -ex
for feature in '' bigint rational complex; do
cargo build --verbose --no-default-features --features="$feature"
cargo test --verbose --no-default-features --features="$feature"
done

7
.travis/test_nightly.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
set -ex
cargo bench --verbose
cargo test --verbose --manifest-path=num-macros/Cargo.toml