.travis.yml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. language: python
  2. sudo: required
  3. dist: trusty
  4. cache: pip
  5. python:
  6. - '2.7'
  7. - '3.4'
  8. - '3.5'
  9. - '3.6'
  10. os:
  11. - linux
  12. stages:
  13. - lint
  14. - test
  15. - integration-test
  16. env:
  17. global:
  18. - PYTHONUNBUFFERED=yes
  19. matrix:
  20. - MATRIX_TOXENV=unit
  21. matrix:
  22. include:
  23. - python: '2.7'
  24. env: MATRIX_TOXENV=integration-rabbitmq
  25. stage: integration-test
  26. services:
  27. - rabbitmq
  28. - python: '2.7'
  29. env: MATRIX_TOXENV=integration-redis
  30. stage: integration-test
  31. services:
  32. - redis
  33. - python: '2.7'
  34. env: MATRIX_TOXENV=integration-dynamodb
  35. stage: integration-test
  36. before_install:
  37. - if [[ -v MATRIX_TOXENV ]]; then export TOXENV=${TRAVIS_PYTHON_VERSION}-${MATRIX_TOXENV}; fi; env
  38. - ./extra/install_dynamodb.sh
  39. - ./extra/install_couchbase_client.sh
  40. - python: '3.4'
  41. env: MATRIX_TOXENV=integration-rabbitmq
  42. stage: integration-test
  43. services:
  44. - rabbitmq
  45. - python: '3.4'
  46. env: MATRIX_TOXENV=integration-redis
  47. stage: integration-test
  48. services:
  49. - redis
  50. - python: '3.4'
  51. env: MATRIX_TOXENV=integration-dynamodb
  52. stage: integration-test
  53. before_install:
  54. - if [[ -v MATRIX_TOXENV ]]; then export TOXENV=${TRAVIS_PYTHON_VERSION}-${MATRIX_TOXENV}; fi; env
  55. - ./extra/install_dynamodb.sh
  56. - ./extra/install_couchbase_client.sh
  57. - python: '3.5'
  58. env: MATRIX_TOXENV=integration-rabbitmq
  59. stage: integration-test
  60. services:
  61. - rabbitmq
  62. - python: '3.5'
  63. env: MATRIX_TOXENV=integration-redis
  64. stage: integration-test
  65. services:
  66. - redis
  67. - python: '3.5'
  68. env: MATRIX_TOXENV=integration-dynamodb
  69. stage: integration-test
  70. before_install:
  71. - if [[ -v MATRIX_TOXENV ]]; then export TOXENV=${TRAVIS_PYTHON_VERSION}-${MATRIX_TOXENV}; fi; env
  72. - ./extra/install_dynamodb.sh
  73. - ./extra/install_couchbase_client.sh
  74. - python: '3.6'
  75. env: MATRIX_TOXENV=integration-rabbitmq
  76. stage: integration-test
  77. services:
  78. - rabbitmq
  79. - python: '3.6'
  80. env: MATRIX_TOXENV=integration-redis
  81. stage: integration-test
  82. services:
  83. - redis
  84. - python: '3.6'
  85. env: MATRIX_TOXENV=integration-dynamodb
  86. stage: integration-test
  87. before_install:
  88. - if [[ -v MATRIX_TOXENV ]]; then export TOXENV=${TRAVIS_PYTHON_VERSION}-${MATRIX_TOXENV}; fi; env
  89. - ./extra/install_dynamodb.sh
  90. - ./extra/install_couchbase_client.sh
  91. - python: '3.6'
  92. env: TOXENV=pypy-integration-rabbitmq PYPY_VERSION="pypy2.7-5.8.0"
  93. stage: integration-test
  94. services:
  95. - rabbitmq
  96. - python: '3.6'
  97. env: TOXENV=pypy-integration-redis PYPY_VERSION="pypy2.7-5.8.0"
  98. stage: integration-test
  99. services:
  100. - redis
  101. - python: '3.6'
  102. env: TOXENV=pypy-integration-dynamodb PYPY_VERSION="pypy2.7-5.8.0"
  103. stage: integration-test
  104. before_install:
  105. - if [[ -v MATRIX_TOXENV ]]; then export TOXENV=${TRAVIS_PYTHON_VERSION}-${MATRIX_TOXENV}; fi; env
  106. - ./extra/install_dynamodb.sh
  107. - |
  108. if [[ "$TOXENV" =~ "pypy" ]]; then
  109. export PYENV_ROOT="$HOME/.pyenv"
  110. if [ -f "$PYENV_ROOT/bin/pyenv" ]; then
  111. cd "$PYENV_ROOT" && git pull
  112. else
  113. rm -rf "$PYENV_ROOT" && git clone --depth 1 https://github.com/pyenv/pyenv.git "$PYENV_ROOT"
  114. fi
  115. "$PYENV_ROOT/bin/pyenv" install "$PYPY_VERSION"
  116. virtualenv --python="$PYENV_ROOT/versions/$PYPY_VERSION/bin/python" "$HOME/virtualenvs/$PYPY_VERSION"
  117. source "$HOME/virtualenvs/$PYPY_VERSION/bin/activate"
  118. which python
  119. fi
  120. - ./extra/install_couchbase_client.sh
  121. - python: '3.6'
  122. env: TOXENV=pypy-unit PYPY_VERSION="pypy2.7-5.8.0"
  123. stage: test
  124. - python: '3.6'
  125. env: TOXENV=flake8
  126. stage: lint
  127. - python: '3.6'
  128. env: TOXENV=flakeplus
  129. stage: lint
  130. - python: '3.6'
  131. env: TOXENV=apicheck
  132. stage: lint
  133. - python: '3.6'
  134. env: TOXENV=configcheck
  135. stage: lint
  136. - python: '3.6'
  137. env: TOXENV=bandit
  138. stage: lint
  139. - python: '3.6'
  140. env: TOXENV=pydocstyle
  141. stage: lint
  142. - python: '3.6'
  143. env: TOXENV=isort-check
  144. stage: lint
  145. before_install:
  146. - if [[ -v MATRIX_TOXENV ]]; then export TOXENV=${TRAVIS_PYTHON_VERSION}-${MATRIX_TOXENV}; fi; env
  147. - |
  148. if [[ "$TOXENV" =~ "pypy" ]]; then
  149. export PYENV_ROOT="$HOME/.pyenv"
  150. if [ -f "$PYENV_ROOT/bin/pyenv" ]; then
  151. cd "$PYENV_ROOT" && git pull
  152. else
  153. rm -rf "$PYENV_ROOT" && git clone --depth 1 https://github.com/pyenv/pyenv.git "$PYENV_ROOT"
  154. fi
  155. "$PYENV_ROOT/bin/pyenv" install "$PYPY_VERSION"
  156. virtualenv --python="$PYENV_ROOT/versions/$PYPY_VERSION/bin/python" "$HOME/virtualenvs/$PYPY_VERSION"
  157. source "$HOME/virtualenvs/$PYPY_VERSION/bin/activate"
  158. which python
  159. fi
  160. - ./extra/install_couchbase_client.sh
  161. after_success:
  162. - |
  163. if [[ -v MATRIX_TOXENV || "$TOXENV" =~ "pypy" ]]; then
  164. .tox/$TOXENV/bin/coverage xml
  165. .tox/$TOXENV/bin/codecov -e TOXENV
  166. fi;
  167. install: travis_retry pip install -U tox | cat
  168. script: tox -v -- -v
  169. notifications:
  170. irc:
  171. channels:
  172. - "chat.freenode.net#celery"
  173. on_success: change
  174. on_failure: change