diff options
-rw-r--r-- | .travis.yml | 16 | ||||
-rw-r--r-- | ci/install.sh | 16 | ||||
-rw-r--r-- | ci/script.sh | 5 |
3 files changed, 22 insertions, 15 deletions
diff --git a/.travis.yml b/.travis.yml index 1fa94fa..7f681bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,22 +13,10 @@ matrix: env: TARGET=x86_64-unknown-linux-gnu install: - # NOTE(TRAVIS_BRANCH) Travis is configured to only build *pushes* (not PRs). - - if [ $TRAVIS_BRANCH != master ] || [ $TRAVIS_EVENT_TYPE = cron ]; then - curl https://sh.rustup.rs -sSf | - sh -s -- -y --default-toolchain $TRAVIS_RUST_VERSION; - - source ~/.cargo/env; - - curl -LSfs http://japaric.github.io/trust/install.sh | \ - sh -s -- --force --git japaric/cross --tag v0.1.2 --target x86_64-unknown-linux-gnu --to ~/.cargo/bin; - fi + - sh ci/install.sh script: - # NOTE(TRAVIS_BRANCH) See the NOTE in the `install` section - - if [ $TRAVIS_BRANCH != master ] || [ $TRAVIS_EVENT_TYPE = cron ]; then - sh ci/script.sh; - fi + - sh ci/script.sh cache: cargo before_cache: diff --git a/ci/install.sh b/ci/install.sh new file mode 100644 index 0000000..f409b71 --- /dev/null +++ b/ci/install.sh @@ -0,0 +1,16 @@ +set -ex + +main() { + curl https://sh.rustup.rs -sSf | \ + sh -s -- -y --default-toolchain $TRAVIS_RUST_VERSION + + source ~/.cargo/env + + curl -LSfs http://japaric.github.io/trust/install.sh | \ + sh -s -- --force --git japaric/cross --tag v0.1.2 --target $TARGET +} + +# NOTE(TRAVIS_BRANCH) Travis is configured to only build *pushes* (not PRs) +if [ $TRAVIS_BRANCH != master ] || [ $TRAVIS_EVENT_TYPE = cron ]; then + main +fi diff --git a/ci/script.sh b/ci/script.sh index b27ef85..5b836d2 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -11,4 +11,7 @@ main() { esac } -main +# NOTE See the NOTE in `install.sh` +if [ $TRAVIS_BRANCH != master ] || [ $TRAVIS_EVENT_TYPE = cron ]; then + main +fi |