.travis.yml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. filter_secrets: false
  2. dist: trusty
  3. sudo: required
  4. group: deprecated-2017Q4
  5. language: python
  6. python: 2.7
  7. branches:
  8. only:
  9. - master
  10. cache:
  11. pip: true
  12. yarn: true
  13. directories:
  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_VERSION="8.9.1"
  31. - YARN_VERSION="1.3.2"
  32. script:
  33. - make travis-lint-$TEST_SUITE
  34. - make travis-test-$TEST_SUITE
  35. - make travis-scan-$TEST_SUITE
  36. after_success:
  37. - pip install codecov
  38. - codecov -e TEST_SUITE
  39. after_failure:
  40. - dmesg | tail -n 100
  41. after_script:
  42. - npm install -g @zeus-ci/cli
  43. - zeus upload -t "text/xml+xunit" junit.xml
  44. - zeus upload -t "text/xml+xunit" jest.junit.xml
  45. - zeus upload -t "text/xml+coverage" coverage.xml
  46. - zeus upload -t "text/xml+coverage" coverage/cobertura-coverage.xml
  47. - zeus upload -t "text/html+pytest" pytest.html
  48. - zeus upload -t "text/plain+pycodestyle" flake8.pycodestyle.log
  49. - zeus upload -t "text/xml+checkstyle" eslint.checkstyle.xml
  50. - zeus upload -t "application/webpack-stats+json" webpack-stats.json
  51. # each job in the matrix inherits `env/global` and uses everything above,
  52. # but custom `services`, `before_install`, `install`, and `before_script` directives
  53. # may be defined to define and setup individual job environments with more precision.
  54. matrix:
  55. fast_finish: true
  56. include:
  57. # only the sqlite suite runs riak tests
  58. - python: 2.7
  59. env: TEST_SUITE=sqlite DB=sqlite
  60. services:
  61. - memcached
  62. - riak
  63. - redis-server
  64. install:
  65. - pip install -e ".[dev,tests,optional]"
  66. - python: 2.7
  67. env: TEST_SUITE=postgres DB=postgres
  68. services:
  69. - memcached
  70. - redis-server
  71. - postgresql
  72. install:
  73. - pip install -e ".[dev,tests,optional]"
  74. before_script:
  75. - psql -c 'create database sentry;' -U postgres
  76. - python: 2.7
  77. env: TEST_SUITE=mysql DB=mysql
  78. services:
  79. - memcached
  80. - mysql
  81. - redis-server
  82. install:
  83. - pip install -e ".[dev,tests,optional]"
  84. - pip install mysqlclient
  85. before_script:
  86. - mysql -u root -e 'create database sentry;'
  87. - python: 2.7
  88. env: TEST_SUITE=acceptance
  89. services:
  90. - memcached
  91. - redis-server
  92. - postgresql
  93. before_install:
  94. - nvm install "$NODE_VERSION"
  95. - npm install -g "yarn@${YARN_VERSION}"
  96. install:
  97. - pip install -e ".[dev,tests,optional]"
  98. - wget -N "http://chromedriver.storage.googleapis.com/$(curl https://chromedriver.storage.googleapis.com/LATEST_RELEASE)/chromedriver_linux64.zip" -P ~/
  99. - unzip ~/chromedriver_linux64.zip -d ~/
  100. - rm ~/chromedriver_linux64.zip
  101. - sudo install -m755 ~/chromedriver /usr/local/bin/
  102. - yarn install --pure-lockfile
  103. before_script:
  104. - psql -c 'create database sentry;' -U postgres
  105. - python: 2.7
  106. env: TEST_SUITE=js
  107. before_install:
  108. - nvm install "$NODE_VERSION"
  109. - npm install -g "yarn@${YARN_VERSION}"
  110. install:
  111. - yarn install --pure-lockfile
  112. - pip install $(cat requirements*.txt | grep -E 'click|pycodestyle')
  113. - python: 2.7
  114. env: TEST_SUITE=cli
  115. services:
  116. - postgresql
  117. - redis-server
  118. install:
  119. - pip install -e .
  120. before_script:
  121. - psql -c 'create database sentry;' -U postgres
  122. - python: 2.7
  123. env: TEST_SUITE=dist
  124. - python: 2.7
  125. env: SENTRY_TAGSTORE=sentry.tagstore.v2.V2TagStorage TEST_SUITE=postgres DB=postgres
  126. services:
  127. - memcached
  128. - redis-server
  129. - postgresql
  130. install:
  131. - pip install -e ".[dev,tests,optional]"
  132. before_script:
  133. - psql -c 'create database sentry;' -U postgres
  134. # django 1.8 in testing - allowed to fail
  135. - python: 2.7
  136. env: TEST_SUITE=postgres DJANGO_VERSION=">=1.8,<1.9"
  137. services:
  138. - memcached
  139. - redis-server
  140. - postgresql
  141. install:
  142. - pip install -e ".[dev,tests,optional]"
  143. before_script:
  144. - psql -c 'create database sentry;' -U postgres
  145. # snuba in testing - allowed to fail
  146. - python: 2.7
  147. env: TEST_SUITE=snuba SENTRY_TAGSTORE=sentry.tagstore.snuba.SnubaTagStorage
  148. services:
  149. - docker
  150. - memcached
  151. - redis-server
  152. - postgresql
  153. before_install:
  154. - docker run -d --name clickhouse-server -p 9000:9000 -p 9009:9009 -p 8123:8123 --ulimit nofile=262144:262144 yandex/clickhouse-server
  155. - 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
  156. - docker ps -a
  157. install:
  158. - pip install -e ".[dev,tests,optional]"
  159. before_script:
  160. - psql -c 'create database sentry;' -U postgres
  161. # Deploy 'storybook' (component & style guide) - allowed to fail
  162. - language: node_js
  163. env: STORYBOOK_BUILD=1
  164. before_install:
  165. # Decrypt the credentials we added to the repo using the key we added with the Travis command line tool
  166. - openssl aes-256-cbc -K $encrypted_020be61ef175_key -iv $encrypted_020be61ef175_iv -in .travis/storybook-credentials.tar.gz.enc -out credentials.tar.gz -d
  167. # If the SDK is not already cached, download it and unpack it
  168. - if [ ! -d ${HOME}/google-cloud-sdk ]; then curl https://sdk.cloud.google.com | bash; fi
  169. - tar -xzf credentials.tar.gz
  170. # Use the decrypted service account credentials to authenticate the command line tool
  171. - gcloud auth activate-service-account --key-file client-secret.json
  172. # Travis doesn't "inherit" steps like before_install in the build matrix, so we have to explicitly install our package managers
  173. - nvm install "$NODE_VERSION"
  174. - npm install -g "yarn@${YARN_VERSION}"
  175. install:
  176. - yarn install --pure-lockfile
  177. - gcloud version
  178. script: bash .travis/deploy-storybook.sh
  179. after_success: skip
  180. after_failure: skip
  181. # jobs are defined in matrix/include
  182. # to specify which jobs are allowed to fail, match the env exactly in matrix/allow_failures
  183. allow_failures:
  184. - python: 2.7
  185. env: TEST_SUITE=postgres DJANGO_VERSION=">=1.8,<1.9"
  186. - python: 2.7
  187. env: TEST_SUITE=snuba SENTRY_TAGSTORE=sentry.tagstore.snuba.SnubaTagStorage
  188. - language: node_js
  189. env: STORYBOOK_BUILD=1
  190. notifications:
  191. webhooks:
  192. urls:
  193. - https://zeus.ci/hooks/fa079cf6-8e6b-11e7-9155-0a580a28081c/public/provider/travis/webhook
  194. on_success: always
  195. on_failure: always
  196. on_start: always
  197. on_cancel: always
  198. on_error: always