.travis.yml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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. chrome: stable
  22. env:
  23. global:
  24. - NODE_ENV=development
  25. - PIP_DISABLE_PIP_VERSION_CHECK=on
  26. - SENTRY_LIGHT_BUILD=1
  27. - SENTRY_SKIP_BACKEND_VALIDATION=1
  28. - SOUTH_TESTS_MIGRATE=1
  29. - DJANGO_VERSION=">=1.6.11,<1.7"
  30. # node's version is pinned by .nvmrc and is autodetected by `nvm install`.
  31. - NODE_DIR="${HOME}/.nvm/versions/node/v$(< .nvmrc)"
  32. - YARN_VERSION="1.3.2"
  33. script:
  34. - make travis-lint-$TEST_SUITE
  35. - make travis-test-$TEST_SUITE
  36. - make travis-scan-$TEST_SUITE
  37. # installing dependencies for after_* steps here ensures they get cached
  38. # since those steps execute after travis runs `store build cache`
  39. - pip install codecov
  40. - npm install -g @zeus-ci/cli
  41. after_success:
  42. - codecov -e TEST_SUITE
  43. after_failure:
  44. - dmesg | tail -n 100
  45. after_script:
  46. - zeus upload -t "text/xml+xunit" junit.xml
  47. -t "text/xml+xunit" jest.junit.xml
  48. -t "text/xml+coverage" coverage.xml
  49. -t "text/xml+coverage" coverage/cobertura-coverage.xml
  50. -t "text/html+pytest" pytest.html
  51. -t "text/plain+pycodestyle" flake8.pycodestyle.log
  52. -t "text/xml+checkstyle" eslint.checkstyle.xml
  53. -t "application/webpack-stats+json" 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. - pip install -e ".[dev,tests,optional]"
  69. - python: 2.7
  70. env: TEST_SUITE=postgres DB=postgres
  71. services:
  72. - memcached
  73. - redis-server
  74. - postgresql
  75. install:
  76. - pip install -e ".[dev,tests,optional]"
  77. before_script:
  78. - psql -c 'create database sentry;' -U postgres
  79. - python: 2.7
  80. env: TEST_SUITE=mysql DB=mysql
  81. services:
  82. - memcached
  83. - mysql
  84. - redis-server
  85. install:
  86. - pip install -e ".[dev,tests,optional]"
  87. - pip install mysqlclient
  88. before_script:
  89. - mysql -u root -e 'create database sentry;'
  90. - python: 2.7
  91. env: TEST_SUITE=acceptance
  92. services:
  93. - memcached
  94. - redis-server
  95. - postgresql
  96. before_install:
  97. - find "$NODE_DIR" -type d -empty -delete
  98. - nvm install
  99. - npm install -g "yarn@${YARN_VERSION}"
  100. install:
  101. - yarn install --pure-lockfile
  102. - pip install -e ".[dev,tests,optional]"
  103. - wget -N "http://chromedriver.storage.googleapis.com/$(curl https://chromedriver.storage.googleapis.com/LATEST_RELEASE)/chromedriver_linux64.zip" -P ~/
  104. - unzip ~/chromedriver_linux64.zip -d ~/
  105. - rm ~/chromedriver_linux64.zip
  106. - sudo install -m755 ~/chromedriver /usr/local/bin/
  107. before_script:
  108. - psql -c 'create database sentry;' -U postgres
  109. - python: 2.7
  110. env: TEST_SUITE=js
  111. before_install:
  112. - find "$NODE_DIR" -type d -empty -delete
  113. - nvm install
  114. - npm install -g "yarn@${YARN_VERSION}"
  115. install:
  116. - yarn install --pure-lockfile
  117. # TODO https://github.com/getsentry/sentry/issues/8451
  118. - pip install $(cat requirements*.txt | grep -E 'click|pycodestyle')
  119. - python: 2.7
  120. env: TEST_SUITE=cli
  121. services:
  122. - postgresql
  123. - redis-server
  124. install:
  125. - pip install -e .
  126. before_script:
  127. - psql -c 'create database sentry;' -U postgres
  128. - python: 2.7
  129. env: TEST_SUITE=dist
  130. - python: 2.7
  131. env: SENTRY_TAGSTORE=sentry.tagstore.v2.V2TagStorage TEST_SUITE=postgres DB=postgres
  132. services:
  133. - memcached
  134. - redis-server
  135. - postgresql
  136. install:
  137. - pip install -e ".[dev,tests,optional]"
  138. before_script:
  139. - psql -c 'create database sentry;' -U postgres
  140. # django 1.8 in testing - allowed to fail
  141. - python: 2.7
  142. env: TEST_SUITE=postgres DJANGO_VERSION=">=1.8,<1.9"
  143. services:
  144. - memcached
  145. - redis-server
  146. - postgresql
  147. install:
  148. - pip install -e ".[dev,tests,optional]"
  149. before_script:
  150. - psql -c 'create database sentry;' -U postgres
  151. # snuba in testing - allowed to fail
  152. - python: 2.7
  153. env: TEST_SUITE=snuba SENTRY_TAGSTORE=sentry.tagstore.snuba.SnubaTagStorage
  154. services:
  155. - docker
  156. - memcached
  157. - redis-server
  158. - postgresql
  159. before_install:
  160. - docker run -d --name clickhouse-server -p 9000:9000 -p 9009:9009 -p 8123:8123 --ulimit nofile=262144:262144 yandex/clickhouse-server
  161. - docker run -d --env SNUBA_SETTINGS=test --env CLICKHOUSE_SERVER=clickhouse-server:9000 --name snuba -p 1218:1218 --link clickhouse-server:clickhouse-server getsentry/snuba
  162. - docker ps -a
  163. install:
  164. - pip install -e ".[dev,tests,optional]"
  165. before_script:
  166. - psql -c 'create database sentry;' -U postgres
  167. # Deploy 'storybook' (component & style guide) - allowed to fail
  168. - language: node_js
  169. env: STORYBOOK_BUILD=1
  170. before_install:
  171. # Decrypt the credentials we added to the repo using the key we added with the Travis command line tool
  172. - openssl aes-256-cbc -K $encrypted_020be61ef175_key -iv $encrypted_020be61ef175_iv -in .travis/storybook-credentials.tar.gz.enc -out credentials.tar.gz -d
  173. # If the SDK is not already cached, download it and unpack it
  174. - if [ ! -d ${HOME}/google-cloud-sdk ]; then curl https://sdk.cloud.google.com | bash; fi
  175. - tar -xzf credentials.tar.gz
  176. # Use the decrypted service account credentials to authenticate the command line tool
  177. - gcloud auth activate-service-account --key-file client-secret.json
  178. - npm install -g "yarn@${YARN_VERSION}"
  179. install:
  180. - yarn install --pure-lockfile
  181. - gcloud version
  182. script: bash .travis/deploy-storybook.sh
  183. after_success: skip
  184. after_failure: skip
  185. # jobs are defined in matrix/include
  186. # to specify which jobs are allowed to fail, match the env exactly in matrix/allow_failures
  187. allow_failures:
  188. - python: 2.7
  189. env: TEST_SUITE=postgres DJANGO_VERSION=">=1.8,<1.9"
  190. - python: 2.7
  191. env: TEST_SUITE=snuba SENTRY_TAGSTORE=sentry.tagstore.snuba.SnubaTagStorage
  192. - language: node_js
  193. env: STORYBOOK_BUILD=1
  194. notifications:
  195. webhooks:
  196. urls:
  197. - https://zeus.ci/hooks/fa079cf6-8e6b-11e7-9155-0a580a28081c/public/provider/travis/webhook
  198. on_success: always
  199. on_failure: always
  200. on_start: always
  201. on_cancel: always
  202. on_error: always