2015-12-29 13:51:26 +00:00
|
|
|
sudo: false
|
|
|
|
language: rust
|
|
|
|
rust:
|
|
|
|
- beta
|
|
|
|
- nightly
|
|
|
|
- stable
|
|
|
|
|
2016-04-29 11:52:50 +00:00
|
|
|
cache: cargo
|
|
|
|
|
2015-12-29 13:51:26 +00:00
|
|
|
matrix:
|
|
|
|
allow_failures:
|
|
|
|
- rust: nightly
|
2016-01-14 11:03:25 +00:00
|
|
|
|
|
|
|
before_install:
|
|
|
|
- |
|
2016-01-31 17:04:01 +00:00
|
|
|
c=$(git diff $(git merge-base master $TRAVIS_COMMIT)..$TRAVIS_COMMIT --name-only | cut -d "/" -f 1 | uniq)
|
2016-01-14 11:03:25 +00:00
|
|
|
if [[ "$c" == "doc" ]]; then
|
|
|
|
echo "Only changes in DOC, exiting 0"
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
echo "Changes in other directories than ./doc"
|
|
|
|
echo "continue build..."
|
|
|
|
fi
|
2015-12-29 13:51:26 +00:00
|
|
|
|
|
|
|
before_script:
|
|
|
|
- |
|
|
|
|
pip install 'travis-cargo<0.2' --user &&
|
|
|
|
export PATH=$HOME/.local/bin:$PATH
|
|
|
|
|
|
|
|
script:
|
|
|
|
- |
|
2016-01-09 22:55:44 +00:00
|
|
|
travis_cargo_run_in() {
|
2016-01-31 17:04:01 +00:00
|
|
|
echo ":: Trying to run cargo in $1"
|
2016-01-09 22:55:44 +00:00
|
|
|
[[ -d "$1" ]] &&
|
|
|
|
cd "$1" &&
|
2016-02-07 00:34:50 +00:00
|
|
|
{
|
2016-07-28 12:37:59 +00:00
|
|
|
travis-cargo -q build &&
|
|
|
|
travis-cargo -q test &&
|
|
|
|
travis-cargo -q bench &&
|
2016-02-07 00:34:50 +00:00
|
|
|
travis-cargo --only stable doc &&
|
|
|
|
cd -
|
|
|
|
} || exit 1
|
2016-01-09 22:55:44 +00:00
|
|
|
}
|
|
|
|
|
2016-01-31 17:04:01 +00:00
|
|
|
run_sh_test() {
|
2016-04-16 14:24:38 +00:00
|
|
|
echo "--- Running test script: '$1'"
|
2016-02-15 13:19:18 +00:00
|
|
|
bash $1 || { echo "--- Test failed. Exiting"; exit 1; }
|
|
|
|
echo "--- Test script $1 executed successfully"
|
2016-01-31 17:04:01 +00:00
|
|
|
}
|
|
|
|
|
2016-02-15 13:19:18 +00:00
|
|
|
echo "<< Changes in ./doc are not build by CI >>"
|
2016-01-16 19:17:16 +00:00
|
|
|
|
2016-01-31 17:04:01 +00:00
|
|
|
for d in $(find -name "Cargo.toml" | grep -vE "^./Cargo.toml$"); do
|
|
|
|
echo ":: Working on $d"
|
2016-01-16 19:17:16 +00:00
|
|
|
dir=$(dirname $d)
|
2016-01-31 17:04:01 +00:00
|
|
|
{ \
|
2016-02-15 13:19:18 +00:00
|
|
|
echo -e "\n--- Running in $d ---\n" && \
|
|
|
|
travis_cargo_run_in $dir && \
|
|
|
|
echo "--- Running test scripts ---" && \
|
2016-01-31 17:04:01 +00:00
|
|
|
for testsh in $(find $dir -iname "*test.sh"); do
|
|
|
|
run_sh_test $testsh
|
|
|
|
done && \
|
2016-02-15 13:19:18 +00:00
|
|
|
echo -e "--- Done with test scripts ---\n\n"
|
2016-02-07 00:34:50 +00:00
|
|
|
} || true
|
2016-01-16 19:17:16 +00:00
|
|
|
done
|
2016-01-16 19:33:20 +00:00
|
|
|
|
2015-12-29 13:51:26 +00:00
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- libcurl4-openssl-dev
|
|
|
|
- libelf-dev
|
|
|
|
- libdw-dev
|
|
|
|
|
|
|
|
after_success:
|
|
|
|
- travis-cargo --only stable doc-upload
|
|
|
|
|
|
|
|
notifications:
|
|
|
|
email:
|
|
|
|
on_success: never
|
|
|
|
|
|
|
|
env:
|
|
|
|
global:
|
|
|
|
- TRAVIS_CARGO_NIGHTLY_FEATURE=dev
|