From a9d6c8db873a36f905199429494edde051825dbe Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Sat, 4 Aug 2018 13:42:00 -0400 Subject: [PATCH] Run snippet tests for stable and beta Rusts --- .travis.yml | 25 +++++++++++++++---------- tests/.travis-runner.sh | 16 ++++++++++++++++ 2 files changed, 31 insertions(+), 10 deletions(-) create mode 100755 tests/.travis-runner.sh diff --git a/.travis.yml b/.travis.yml index 51da0a9d6..d99dadcf5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,13 +24,18 @@ matrix: directories: - /home/travis/.cargo - target - before_script: - - curl -sSf https://build.travis-ci.org/files/rustup-init.sh | sh -s -- --default-toolchain=stable -y - - export PATH=$HOME/.cargo/bin:$PATH - install: - - pip install pipenv - - (cd tests; pipenv install) - script: - # Build outside of the test runner - - cargo build --verbose --release - - (cd tests; pipenv run pytest) + env: + - TRAVIS_RUST_VERSION=stable + script: tests/.travis-runner.sh + - language: python + python: 3.6 + cache: + pip: true + # Because we're using the Python Travis environment, we can't use + # the built-in cargo cacher + directories: + - /home/travis/.cargo + - target + env: + - TRAVIS_RUST_VERSION=beta + script: tests/.travis-runner.sh diff --git a/tests/.travis-runner.sh b/tests/.travis-runner.sh new file mode 100755 index 000000000..680b18ea4 --- /dev/null +++ b/tests/.travis-runner.sh @@ -0,0 +1,16 @@ +#!/bin/sh -eux +# This script is intended to be run in Travis from the root of the repository + +# Install Rust +curl -sSf https://build.travis-ci.org/files/rustup-init.sh | sh -s -- --default-toolchain=$TRAVIS_RUST_VERSION -y +export PATH=$HOME/.cargo/bin:$PATH + +# Install pipenv +pip install pipenv +(cd tests; pipenv install) + +# Build outside of the test runner +cargo build --verbose --release + +# Run the tests +(cd tests; pipenv run pytest)