diff --git a/.travis.yml b/.travis.yml index 027bc513..ea846006 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ language: rust +cache: cargo rust: - nightly script: ./scripts/test.sh diff --git a/examples/todo/bootstrap.sh b/examples/todo/bootstrap.sh index 77921440..89aba9da 100755 --- a/examples/todo/bootstrap.sh +++ b/examples/todo/bootstrap.sh @@ -3,10 +3,12 @@ SCRIPT_PATH=$(cd "$(dirname "$0")" ; pwd -P) DATABASE_URL=${SCRIPT_PATH}/db/db.sql -pushd $SCRIPT_PATH - # install the diesel CLI tools - cargo install diesel_cli +pushd $SCRIPT_PATH > /dev/null + # install the diesel CLI tools if they're not installed + if ! command -v diesel >/dev/null 2>&1; then + cargo install diesel_cli + fi # create db/db.sql diesel migration --database-url=$DATABASE_URL run -popd $SCRIPT_PATH +popd $SCRIPT_PATH > /dev/null diff --git a/scripts/test.sh b/scripts/test.sh index ef4b87c8..eb00e6c4 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -46,6 +46,9 @@ function check_versions_match() { done } +# Update dependencies first. +cargo update + build_and_test "${LIB_DIR}" build_and_test "${CODEGEN_DIR}" build_and_test "${CONTRIB_DIR}"