diff --git a/.travis.yml b/.travis.yml index 04cc170..893296a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,28 +7,14 @@ sudo: false script: - cargo build --verbose - cargo test --verbose - - | - (for feature in '' bigint rational complex; do - 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 - ) + - .travis/test_features.sh + - [ $TRAVIS_RUST_VERSION = nightly ] .travis/test_nightly.sh - cargo doc after_success: | [ $TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ] && [ $TRAVIS_RUST_VERSION = nightly ] && - openssl aes-256-cbc -K $encrypted_9e86330b283d_key -iv $encrypted_9e86330b283d_iv -in .travis/deploy.enc -out .travis/deploy -d && - 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 + ssh-agent .travis/deploy.sh notifications: email: on_success: never diff --git a/.travis/.gitignore b/.travis/.gitignore new file mode 100644 index 0000000..4cb44b1 --- /dev/null +++ b/.travis/.gitignore @@ -0,0 +1 @@ +/deploy diff --git a/.travis/deploy.sh b/.travis/deploy.sh new file mode 100755 index 0000000..c342036 --- /dev/null +++ b/.travis/deploy.sh @@ -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 diff --git a/.travis/test_features.sh b/.travis/test_features.sh new file mode 100755 index 0000000..150ac41 --- /dev/null +++ b/.travis/test_features.sh @@ -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 + diff --git a/.travis/test_nightly.sh b/.travis/test_nightly.sh new file mode 100755 index 0000000..475dfc1 --- /dev/null +++ b/.travis/test_nightly.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +set -ex + +cargo bench --verbose + +cargo test --verbose --manifest-path=num-macros/Cargo.toml