.travis.yml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. dist: trusty
  2. sudo: required
  3. group: deprecated-2017Q4
  4. language: python
  5. python: 2.7
  6. branches:
  7. only:
  8. - master
  9. cache:
  10. yarn: true
  11. directories:
  12. - "${HOME}/virtualenv/python$(python -c 'import platform; print(platform.python_version())')"
  13. - "$NODE_DIR"
  14. - node_modules
  15. - "${HOME}/google-cloud-sdk"
  16. addons:
  17. apt:
  18. update: true
  19. packages:
  20. - libxmlsec1-dev
  21. - libgeoip-dev
  22. chrome: stable
  23. env:
  24. global:
  25. - NODE_ENV=development
  26. - PIP_DISABLE_PIP_VERSION_CHECK=on
  27. - SENTRY_LIGHT_BUILD=1
  28. - SENTRY_SKIP_BACKEND_VALIDATION=1
  29. - SOUTH_TESTS_MIGRATE=1
  30. - DJANGO_VERSION=">=1.6.11,<1.7"
  31. # node's version is pinned by .nvmrc and is autodetected by `nvm install`.
  32. - NODE_DIR="${HOME}/.nvm/versions/node/v$(< .nvmrc)"
  33. - YARN_VERSION="1.3.2"
  34. script:
  35. - make travis-lint-$TEST_SUITE
  36. - make travis-test-$TEST_SUITE
  37. - make travis-scan-$TEST_SUITE
  38. # installing dependencies for after_* steps here ensures they get cached
  39. # since those steps execute after travis runs `store build cache`
  40. - pip install codecov
  41. - npm install -g @zeus-ci/cli
  42. after_success:
  43. - codecov -e TEST_SUITE
  44. after_failure:
  45. - dmesg | tail -n 100
  46. after_script:
  47. - zeus upload -t "text/xml+xunit" .artifacts/*junit.xml
  48. - zeus upload -t "text/xml+coverage" .artifacts/*coverage.xml
  49. - zeus upload -t "text/xml+coverage" .artifacts/coverage/cobertura-coverage.xml
  50. - zeus upload -t "text/html+pytest" .artifacts/*pytest.html
  51. - zeus upload -t "text/plain+pycodestyle" .artifacts/*pycodestyle.log
  52. - zeus upload -t "text/xml+checkstyle" .artifacts/*checkstyle.xml
  53. - zeus upload -t "application/webpack-stats+json" .artifacts/*webpack-stats.json
  54. # each job in the matrix inherits `env/global` and uses everything above,
  55. # but custom `services`, `before_install`, `install`, and `before_script` directives
  56. # may be defined to define and setup individual job environments with more precision.
  57. matrix:
  58. fast_finish: true
  59. include:
  60. # only the sqlite suite runs riak tests
  61. - python: 2.7
  62. env: TEST_SUITE=sqlite DB=sqlite
  63. services:
  64. - memcached
  65. - riak
  66. - redis-server
  67. install:
  68. - python setup.py install_egg_info
  69. - pip install -e ".[dev,tests,optional]"
  70. - python: 2.7
  71. env: TEST_SUITE=postgres DB=postgres
  72. services:
  73. - memcached
  74. - redis-server
  75. - postgresql
  76. install:
  77. - python setup.py install_egg_info
  78. - pip install -e ".[dev,tests,optional]"
  79. before_script:
  80. - psql -c 'create database sentry;' -U postgres
  81. - python: 2.7
  82. env:
  83. - TEST_SUITE=postgres DB=postgres
  84. - SENTRY_USE_RUST_NORMALIZER=true
  85. services:
  86. - memcached
  87. - redis-server
  88. - postgresql
  89. install:
  90. - python setup.py install_egg_info
  91. - pip install -e ".[dev,tests,optional]"
  92. before_script:
  93. - psql -c 'create database sentry;' -U postgres
  94. - python: 2.7
  95. env: TEST_SUITE=mysql DB=mysql
  96. services:
  97. - memcached
  98. - mysql
  99. - redis-server
  100. install:
  101. - python setup.py install_egg_info
  102. - pip install -e ".[dev,tests,optional]"
  103. # 1.3.14 causes test failures. Pinning to 1.3.13 for now, hopefully
  104. # a later release resolves this.
  105. - pip install mysqlclient==1.3.13
  106. before_script:
  107. - mysql -u root -e 'create database sentry;'
  108. - python: 2.7
  109. env: TEST_SUITE=acceptance
  110. services:
  111. - memcached
  112. - redis-server
  113. - postgresql
  114. before_install:
  115. - find "$NODE_DIR" -type d -empty -delete
  116. - nvm install
  117. - npm install -g "yarn@${YARN_VERSION}"
  118. - docker run -d --network host --name clickhouse-server --ulimit nofile=262144:262144 yandex/clickhouse-server:18.14.9
  119. - docker run -d --network host --name snuba --env SNUBA_SETTINGS=test --env CLICKHOUSE_SERVER=localhost:9000 getsentry/snuba
  120. - docker ps -a
  121. install:
  122. - yarn install --pure-lockfile
  123. - python setup.py install_egg_info
  124. - pip install -e ".[dev,tests,optional]"
  125. - wget -N "https://chromedriver.storage.googleapis.com/2.45/chromedriver_linux64.zip" -P ~/
  126. - unzip ~/chromedriver_linux64.zip -d ~/
  127. - rm ~/chromedriver_linux64.zip
  128. - sudo install -m755 ~/chromedriver /usr/local/bin/
  129. before_script:
  130. - psql -c 'create database sentry;' -U postgres
  131. - python: 2.7
  132. env: TEST_SUITE=js
  133. before_install:
  134. - find "$NODE_DIR" -type d -empty -delete
  135. - nvm install
  136. - npm install -g "yarn@${YARN_VERSION}"
  137. install:
  138. - yarn install --pure-lockfile
  139. - python: 2.7
  140. env: TEST_SUITE=cli
  141. services:
  142. - postgresql
  143. - redis-server
  144. install:
  145. - python setup.py install_egg_info
  146. - pip install -e .
  147. before_script:
  148. - psql -c 'create database sentry;' -U postgres
  149. - python: 2.7
  150. env: TEST_SUITE=dist
  151. before_install:
  152. - find "$NODE_DIR" -type d -empty -delete
  153. - nvm install
  154. - npm install -g "yarn@${YARN_VERSION}"
  155. - python: 2.7
  156. env: SENTRY_TAGSTORE=sentry.tagstore.v2.V2TagStorage TEST_SUITE=postgres DB=postgres
  157. services:
  158. - memcached
  159. - redis-server
  160. - postgresql
  161. install:
  162. - python setup.py install_egg_info
  163. - pip install -e ".[dev,tests,optional]"
  164. before_script:
  165. - psql -c 'create database sentry;' -U postgres
  166. # django 1.8 compatibility
  167. - python: 2.7
  168. env: TEST_SUITE=postgres DJANGO_VERSION=">=1.8,<1.9"
  169. services:
  170. - memcached
  171. - redis-server
  172. - postgresql
  173. install:
  174. - python setup.py install_egg_info
  175. - pip install -e ".[dev,tests,optional]"
  176. before_script:
  177. - psql -c 'create database sentry;' -U postgres
  178. # django 1.8 compatibility with migrations
  179. - python: 2.7
  180. env: TEST_SUITE=postgres DJANGO_VERSION=">=1.8,<1.9" SOUTH_TESTS_MIGRATE=0
  181. services:
  182. - memcached
  183. - redis-server
  184. - postgresql
  185. install:
  186. - python setup.py install_egg_info
  187. - pip install -e ".[dev,tests,optional]"
  188. before_script:
  189. - psql -c 'create database sentry;' -U postgres
  190. # snuba in testing
  191. - python: 2.7
  192. env: TEST_SUITE=snuba SENTRY_TAGSTORE=sentry.tagstore.snuba.SnubaTagStorage SENTRY_ZOOKEEPER_HOSTS=localhost:2181 SENTRY_KAFKA_HOSTS=localhost:9092
  193. services:
  194. - docker
  195. - memcached
  196. - redis-server
  197. - postgresql
  198. before_install:
  199. - docker run -d --network host --name zookeeper -e ZOOKEEPER_CLIENT_PORT=2181 confluentinc/cp-zookeeper:4.1.0
  200. - docker run -d --network host --name kafka -e KAFKA_ZOOKEEPER_CONNECT=localhost:2181 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 -e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 confluentinc/cp-kafka:4.1.0
  201. - docker run -d --network host --name clickhouse-server --ulimit nofile=262144:262144 yandex/clickhouse-server:18.14.9
  202. - docker run -d --network host --name snuba --env SNUBA_SETTINGS=test --env CLICKHOUSE_SERVER=localhost:9000 getsentry/snuba
  203. - docker ps -a
  204. install:
  205. - python setup.py install_egg_info
  206. - pip install -e ".[dev,tests,optional]"
  207. - pip install confluent-kafka
  208. before_script:
  209. - psql -c 'create database sentry;' -U postgres
  210. # Deploy 'storybook' (component & style guide) - allowed to fail
  211. - language: node_js
  212. env: STORYBOOK_BUILD=1
  213. before_install:
  214. # Decrypt the credentials we added to the repo using the key we added with the Travis command line tool
  215. - openssl aes-256-cbc -K $encrypted_020be61ef175_key -iv $encrypted_020be61ef175_iv -in .travis/storybook-credentials.tar.gz.enc -out credentials.tar.gz -d
  216. # If the SDK is not already cached, download it and unpack it
  217. - if [ ! -d ${HOME}/google-cloud-sdk ]; then curl https://sdk.cloud.google.com | bash; fi
  218. - tar -xzf credentials.tar.gz
  219. # Use the decrypted service account credentials to authenticate the command line tool
  220. - gcloud auth activate-service-account --key-file client-secret.json
  221. - npm install -g "yarn@${YARN_VERSION}"
  222. install:
  223. - yarn install --pure-lockfile
  224. - gcloud version
  225. script: bash .travis/deploy-storybook.sh
  226. after_success: skip
  227. after_failure: skip
  228. # jobs are defined in matrix/include
  229. # to specify which jobs are allowed to fail, match the env exactly in matrix/allow_failures
  230. allow_failures:
  231. - language: node_js
  232. env: STORYBOOK_BUILD=1
  233. notifications:
  234. webhooks:
  235. urls:
  236. - https://zeus.ci/hooks/fa079cf6-8e6b-11e7-9155-0a580a28081c/public/provider/travis/webhook
  237. on_success: always
  238. on_failure: always
  239. on_start: always
  240. on_cancel: always
  241. on_error: always