.travis.yml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. language: c
  2. ## Comment out the compiler list for now to allow an explicit build
  3. ## matrix.
  4. # compiler:
  5. # - gcc
  6. # - clang
  7. notifications:
  8. irc:
  9. channels:
  10. - "irc.oftc.net#tor-ci"
  11. template:
  12. - "%{repository} %{branch} %{commit} - %{author}: %{commit_subject}"
  13. - "Build #%{build_number} %{result}. Details: %{build_url}"
  14. on_success: change
  15. on_failure: change
  16. email:
  17. on_success: never
  18. on_failure: change
  19. os:
  20. - linux
  21. ## Uncomment the following line to also run the entire build matrix on OSX.
  22. ## This will make your CI builds take roughly ten times longer to finish.
  23. # - osx
  24. ## Use the Ubuntu Trusty images.
  25. dist: trusty
  26. ## We don't need sudo. (The "apt:" stanza after this allows us to not need sudo;
  27. ## otherwise, we would need it for getting dependencies.)
  28. ##
  29. ## We override this in the explicit build matrix to work around a
  30. ## Travis CI environment regression
  31. ## https://github.com/travis-ci/travis-ci/issues/9033
  32. sudo: false
  33. ## (Linux only) Download our dependencies
  34. addons:
  35. apt:
  36. packages:
  37. ## Required dependencies
  38. - libevent-dev
  39. - libseccomp2
  40. - zlib1g-dev
  41. ## Optional dependencies
  42. - liblzma-dev
  43. - libscrypt-dev
  44. ## zstd doesn't exist in Ubuntu Trusty
  45. #- libzstd
  46. ## The build matrix in the following two stanzas expands into four builds (per OS):
  47. ##
  48. ## * with GCC, with Rust
  49. ## * with GCC, without Rust
  50. ## * with Clang, with Rust
  51. ## * with Clang, without Rust
  52. env:
  53. global:
  54. ## The Travis CI environment allows us two cores, so let's use both.
  55. - MAKEFLAGS="-j 2"
  56. matrix:
  57. ## Uncomment to allow the build to report success (with non-required
  58. ## sub-builds continuing to run) if all required sub-builds have
  59. ## succeeded. This is somewhat buggy currently: it can cause
  60. ## duplicate notifications and prematurely report success if a
  61. ## single sub-build has succeeded. See
  62. ## https://github.com/travis-ci/travis-ci/issues/1696
  63. # fast_finish: true
  64. ## Uncomment the appropriate lines below to allow the build to
  65. ## report success even if some less-critical sub-builds fail and it
  66. ## seems likely to take a while for someone to fix it. Currently
  67. ## Travis CI doesn't distinguish "all builds succeeded" from "some
  68. ## non-required sub-builds failed" except on the individual build's
  69. ## page, which makes it somewhat annoying to detect from the
  70. ## branches and build history pages. See
  71. ## https://github.com/travis-ci/travis-ci/issues/8716
  72. allow_failures:
  73. # - env: RUST_OPTIONS="--enable-rust" TOR_RUST_DEPENDENCIES=true
  74. # - env: RUST_OPTIONS="--enable-rust --enable-cargo-online-mode
  75. # - compiler: clang
  76. ## Create explicit matrix entries to work around a Travis CI
  77. ## environment issue. Missing keys inherit from the first list
  78. ## entry under that key outside the "include" clause.
  79. include:
  80. - compiler: gcc
  81. ## The "sudo: required" forces non-containerized builds, working
  82. ## around a Travis CI environment issue: clang LeakAnalyzer fails
  83. ## because it requires ptrace and the containerized environment no
  84. ## longer allows ptrace.
  85. - compiler: clang
  86. sudo: required
  87. before_install:
  88. ## If we're on OSX, homebrew usually needs to updated first
  89. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
  90. ## Download rustup
  91. - curl -Ssf -o rustup.sh https://sh.rustup.rs
  92. install:
  93. ## If we're on OSX use brew to install required dependencies (for Linux, see the "apt:" section above)
  94. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated openssl || brew upgrade openssl; }; fi
  95. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated libevent || brew upgrade libevent; }; fi
  96. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated pkg-config || brew upgrade pkg-config; }; fi
  97. ## If we're on OSX also install the optional dependencies
  98. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated xz || brew upgrade xz; }; fi
  99. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated libscrypt || brew upgrade libscrypt; }; fi
  100. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated zstd || brew upgrade zstd; }; fi
  101. script:
  102. - ./autogen.sh
  103. - ./configure $RUST_OPTIONS --disable-asciidoc --enable-fatal-warnings --disable-silent-rules --enable-fragile-hardening
  104. ## We run `make check` because that's what https://jenkins.torproject.org does.
  105. - make check
  106. after_failure:
  107. ## `make check` will leave a log file with more details of test failures.
  108. - cat test-suite.log