.travis.yml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. language: c
  2. compiler:
  3. - gcc
  4. - clang
  5. notifications:
  6. irc:
  7. channels:
  8. - "irc.oftc.net#tor-ci"
  9. template:
  10. - "%{repository} %{branch} %{commit} - %{author}: %{commit_subject}"
  11. - "Build #%{build_number} %{result}. Details: %{build_url}"
  12. on_success: change
  13. on_failure: change
  14. email:
  15. on_success: never
  16. on_failure: change
  17. os:
  18. - linux
  19. ## Uncomment the following line to also run the entire build matrix on OSX.
  20. ## This will make your CI builds take roughly ten times longer to finish.
  21. # - osx
  22. ## Use the Ubuntu Trusty images.
  23. dist: trusty
  24. ## We don't need sudo. (The "apt:" stanza after this allows us to not need sudo;
  25. ## otherwise, we would need it for getting dependencies.)
  26. sudo: false
  27. ## (Linux only) Download our dependencies
  28. addons:
  29. apt:
  30. packages:
  31. ## Required dependencies
  32. - libevent-dev
  33. - libseccomp2
  34. - zlib1g-dev
  35. ## Optional dependencies
  36. - liblzma-dev
  37. - libscrypt-dev
  38. ## zstd doesn't exist in Ubuntu Trusty
  39. #- libzstd
  40. ## The build matrix in the following two stanzas expands into four builds (per OS):
  41. ##
  42. ## * with GCC, with Rust
  43. ## * with GCC, without Rust
  44. ## * with Clang, with Rust
  45. ## * with Clang, without Rust
  46. env:
  47. global:
  48. ## The Travis CI environment allows us two cores, so let's use both.
  49. - MAKEFLAGS="-j 2"
  50. matrix:
  51. - RUST_OPTIONS="--enable-rust --enable-cargo-online-mode"
  52. - RUST_OPTIONS=""
  53. matrix:
  54. ## If one build in the matrix fails (e.g. if building withour Rust and Clang
  55. ## fails, but building with Rust and GCC is still going), then cancel the
  56. ## entire job early and call the whole thing a failure.
  57. fast_finish: true
  58. before_install:
  59. ## If we're on OSX, homebrew usually needs to updated first
  60. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
  61. ## Download rustup
  62. - if [[ "$RUST_OPTIONS" != "" ]]; then curl -Ssf -o rustup.sh https://sh.rustup.rs; fi
  63. install:
  64. ## If we're on OSX use brew to install required dependencies (for Linux, see the "apt:" section above)
  65. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated openssl || brew upgrade openssl; }; fi
  66. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated libevent || brew upgrade libevent; }; fi
  67. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated pkg-config || brew upgrade pkg-config; }; fi
  68. ## If we're on OSX also install the optional dependencies
  69. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated xz || brew upgrade xz; }; fi
  70. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated libscrypt || brew upgrade libscrypt; }; fi
  71. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated zstd || brew upgrade zstd; }; fi
  72. ## Install the nightly channels of rustc and cargo and setup our toolchain environment
  73. - if [[ "$RUST_OPTIONS" != "" ]]; then sh rustup.sh -y --default-toolchain nightly; fi
  74. - if [[ "$RUST_OPTIONS" != "" ]]; then source $HOME/.cargo/env; fi
  75. ## Get some info about rustc and cargo
  76. - if [[ "$RUST_OPTIONS" != "" ]]; then which rustc; fi
  77. - if [[ "$RUST_OPTIONS" != "" ]]; then which cargo; fi
  78. - if [[ "$RUST_OPTIONS" != "" ]]; then rustc --version; fi
  79. - if [[ "$RUST_OPTIONS" != "" ]]; then cargo --version; fi
  80. script:
  81. - ./autogen.sh
  82. - ./configure $RUST_OPTIONS --disable-asciidoc --enable-fatal-warnings --disable-silent-rules --enable-fragile-hardening
  83. ## We run `make check` because that's what https://jenkins.torproject.org does.
  84. - make check
  85. after_failure:
  86. ## `make check` will leave a log file with more details of test failures.
  87. - cat test-suite.log