.travis.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. sudo: false
  2. language: rust
  3. rust:
  4. - beta
  5. - nightly
  6. - stable
  7. cache: cargo
  8. matrix:
  9. allow_failures:
  10. - rust: nightly
  11. before_install:
  12. - |
  13. c=$(git diff $(git merge-base master $TRAVIS_COMMIT)..$TRAVIS_COMMIT --name-only | cut -d "/" -f 1 | uniq)
  14. if [[ "$c" == "doc" ]]; then
  15. echo "Only changes in DOC, exiting 0"
  16. exit 0
  17. else
  18. echo "Changes in other directories than ./doc"
  19. echo "continue build..."
  20. fi
  21. before_script:
  22. - |
  23. pip install 'travis-cargo<0.2' --user &&
  24. export PATH=$HOME/.local/bin:$PATH
  25. script:
  26. - |
  27. travis_cargo_run_in() {
  28. echo ":: Trying to run cargo in $1"
  29. [[ -d "$1" ]] &&
  30. cd "$1" &&
  31. {
  32. travis-cargo -q build &&
  33. travis-cargo -q test &&
  34. travis-cargo -q bench &&
  35. travis-cargo --only stable doc &&
  36. cd -
  37. } || exit 1
  38. }
  39. run_sh_test() {
  40. echo "--- Running test script: '$1'"
  41. bash $1 || { echo "--- Test failed. Exiting"; exit 1; }
  42. echo "--- Test script $1 executed successfully"
  43. }
  44. echo "<< Changes in ./doc are not build by CI >>"
  45. for d in $(find -name "Cargo.toml" | grep -vE "^./Cargo.toml$"); do
  46. echo ":: Working on $d"
  47. dir=$(dirname $d)
  48. { \
  49. echo -e "\n--- Running in $d ---\n" && \
  50. travis_cargo_run_in $dir && \
  51. echo "--- Running test scripts ---" && \
  52. for testsh in $(find $dir -iname "*test.sh"); do
  53. run_sh_test $testsh
  54. done && \
  55. echo -e "--- Done with test scripts ---\n\n"
  56. } || true
  57. done
  58. addons:
  59. apt:
  60. packages:
  61. - libcurl4-openssl-dev
  62. - libelf-dev
  63. - libdw-dev
  64. after_success:
  65. - travis-cargo --only stable doc-upload
  66. notifications:
  67. email:
  68. on_success: never
  69. env:
  70. global:
  71. - TRAVIS_CARGO_NIGHTLY_FEATURE=dev