.travis.yml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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: ./extra/install_dynamodb.sh
  37. - python: '3.4'
  38. env: MATRIX_TOXENV=integration-rabbitmq
  39. stage: integration-test
  40. services:
  41. - rabbitmq
  42. - python: '3.4'
  43. env: MATRIX_TOXENV=integration-redis
  44. stage: integration-test
  45. services:
  46. - redis
  47. - python: '3.4'
  48. env: MATRIX_TOXENV=integration-dynamodb
  49. stage: integration-test
  50. before_install: ./extra/install_dynamodb.sh
  51. - python: '3.5'
  52. env: MATRIX_TOXENV=integration-rabbitmq
  53. stage: integration-test
  54. services:
  55. - rabbitmq
  56. - python: '3.5'
  57. env: MATRIX_TOXENV=integration-redis
  58. stage: integration-test
  59. services:
  60. - redis
  61. - python: '3.5'
  62. env: MATRIX_TOXENV=integration-dynamodb
  63. stage: integration-test
  64. before_install: ./extra/install_dynamodb.sh
  65. - python: '3.6'
  66. env: MATRIX_TOXENV=integration-rabbitmq
  67. stage: integration-test
  68. services:
  69. - rabbitmq
  70. - python: '3.6'
  71. env: MATRIX_TOXENV=integration-redis
  72. stage: integration-test
  73. services:
  74. - redis
  75. - python: '3.6'
  76. env: MATRIX_TOXENV=integration-dynamodb
  77. stage: integration-test
  78. before_install: ./extra/install_dynamodb.sh
  79. - python: '3.6'
  80. env: TOXENV=pypy-integration-rabbitmq PYPY_VERSION="pypy2.7-5.8.0"
  81. stage: integration-test
  82. services:
  83. - rabbitmq
  84. - python: '3.6'
  85. env: TOXENV=pypy-integration-redis PYPY_VERSION="pypy2.7-5.8.0"
  86. stage: integration-test
  87. services:
  88. - redis
  89. - python: '3.6'
  90. env: TOXENV=pypy-integration-dynamodb PYPY_VERSION="pypy2.7-5.8.0"
  91. stage: integration-test
  92. before_install: ./extra/install_dynamodb.sh
  93. - python: '3.6'
  94. env: TOXENV=pypy-unit PYPY_VERSION="pypy2.7-5.8.0"
  95. - python: '3.6'
  96. env: TOXENV=flake8
  97. stage: lint
  98. - python: '3.6'
  99. env: TOXENV=flakeplus
  100. stage: lint
  101. - python: '3.6'
  102. env: TOXENV=apicheck
  103. stage: lint
  104. - python: '3.6'
  105. env: TOXENV=configcheck
  106. stage: lint
  107. - python: '3.6'
  108. env: TOXENV=bandit
  109. stage: lint
  110. - python: '3.6'
  111. env: TOXENV=pydocstyle
  112. stage: lint
  113. - python: '3.6'
  114. env: TOXENV=isort-check
  115. stage: lint
  116. before_install:
  117. - if [[ -v MATRIX_TOXENV ]]; then export TOXENV=${TRAVIS_PYTHON_VERSION}-${MATRIX_TOXENV}; fi; env
  118. - |
  119. if [[ "$TOXENV" =~ "pypy" ]]; then
  120. export PYENV_ROOT="$HOME/.pyenv"
  121. if [ -f "$PYENV_ROOT/bin/pyenv" ]; then
  122. cd "$PYENV_ROOT" && git pull
  123. else
  124. rm -rf "$PYENV_ROOT" && git clone --depth 1 https://github.com/pyenv/pyenv.git "$PYENV_ROOT"
  125. fi
  126. "$PYENV_ROOT/bin/pyenv" install "$PYPY_VERSION"
  127. virtualenv --python="$PYENV_ROOT/versions/$PYPY_VERSION/bin/python" "$HOME/virtualenvs/$PYPY_VERSION"
  128. source "$HOME/virtualenvs/$PYPY_VERSION/bin/activate"
  129. which python
  130. fi
  131. - |
  132. if [[ "$TOXENV" == *dynamodb ]]; then
  133. sudo apt-get update && sudo apt-get install -y default-jre supervisor
  134. mkdir /opt/dynamodb-local
  135. cd /opt/dynamodb-local && curl --retry 5 --retry-delay 1 -L http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest.tar.gz | tar zx
  136. cd -
  137. echo '[program:dynamodb-local]' | sudo tee /etc/supervisor/conf.d/dynamodb-local.conf
  138. echo 'command=java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -inMemory' | sudo tee -a /etc/supervisor/conf.d/dynamodb-local.conf
  139. echo 'directory=/opt/dynamodb-local' | sudo tee -a /etc/supervisor/conf.d/dynamodb-local.conf
  140. sudo service supervisor stop
  141. sudo service supervisor start
  142. sleep 10
  143. curl localhost:8000
  144. fi
  145. - |
  146. wget -qO - https://packages.couchbase.com/ubuntu/couchbase.key | sudo apt-key add -
  147. sudo apt-add-repository -y 'deb http://packages.couchbase.com/ubuntu trusty trusty/main'
  148. sudo apt-get update && sudo apt-get install -y libcouchbase-dev
  149. after_success:
  150. - |
  151. if [[ -v MATRIX_TOXENV || "$TOXENV" =~ "pypy" ]]; then
  152. .tox/$TOXENV/bin/coverage xml
  153. .tox/$TOXENV/bin/codecov -e TOXENV
  154. fi;
  155. install: travis_retry pip install -U tox | cat
  156. script: tox -v -- -v
  157. notifications:
  158. irc:
  159. channels:
  160. - "chat.freenode.net#celery"
  161. on_success: change
  162. on_failure: change