.travis.yml 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. env:
  16. global:
  17. - PYTHONUNBUFFERED=yes
  18. matrix:
  19. - MATRIX_TOXENV=unit
  20. - MATRIX_TOXENV=integration-rabbitmq
  21. - MATRIX_TOXENV=integration-redis
  22. - MATRIX_TOXENV=integration-dynamodb
  23. matrix:
  24. include:
  25. - python: '3.5'
  26. env: TOXENV=pypy-unit PYPY_VERSION="pypy2.7-5.8.0"
  27. - python: '3.5'
  28. env: TOXENV=pypy-integration-rabbitmq PYPY_VERSION="pypy2.7-5.8.0"
  29. - python: '3.5'
  30. env: TOXENV=pypy-integration-redis PYPY_VERSION="pypy2.7-5.8.0"
  31. - python: '3.5'
  32. env: TOXENV=pypy-integration-dynamodb PYPY_VERSION="pypy2.7-5.8.0"
  33. - python: '3.5'
  34. env: TOXENV=flake8
  35. stage: lint
  36. - python: '3.5'
  37. env: TOXENV=flakeplus
  38. stage: lint
  39. - python: '3.5'
  40. env: TOXENV=apicheck
  41. stage: lint
  42. - python: '3.5'
  43. env: TOXENV=configcheck
  44. stage: lint
  45. - python: '3.5'
  46. env: TOXENV=pydocstyle
  47. stage: lint
  48. - python: '3.5'
  49. env: TOXENV=isort-check
  50. stage: lint
  51. before_install:
  52. - if [[ -v MATRIX_TOXENV ]]; then export TOXENV=${TRAVIS_PYTHON_VERSION}-${MATRIX_TOXENV}; fi; env
  53. - |
  54. if [[ "$TOXENV" =~ "pypy" ]]; then
  55. export PYENV_ROOT="$HOME/.pyenv"
  56. if [ -f "$PYENV_ROOT/bin/pyenv" ]; then
  57. cd "$PYENV_ROOT" && git pull
  58. else
  59. rm -rf "$PYENV_ROOT" && git clone --depth 1 https://github.com/pyenv/pyenv.git "$PYENV_ROOT"
  60. fi
  61. "$PYENV_ROOT/bin/pyenv" install "$PYPY_VERSION"
  62. virtualenv --python="$PYENV_ROOT/versions/$PYPY_VERSION/bin/python" "$HOME/virtualenvs/$PYPY_VERSION"
  63. source "$HOME/virtualenvs/$PYPY_VERSION/bin/activate"
  64. which python
  65. fi
  66. - |
  67. if [[ "$TOXENV" == *dynamodb ]]; then
  68. sudo apt-get update && sudo apt-get install -y default-jre supervisor
  69. mkdir /opt/dynamodb-local
  70. 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
  71. cd -
  72. echo '[program:dynamodb-local]' | sudo tee /etc/supervisor/conf.d/dynamodb-local.conf
  73. echo 'command=java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -inMemory' | sudo tee -a /etc/supervisor/conf.d/dynamodb-local.conf
  74. echo 'directory=/opt/dynamodb-local' | sudo tee -a /etc/supervisor/conf.d/dynamodb-local.conf
  75. sudo service supervisor stop
  76. sudo service supervisor start
  77. sleep 10
  78. curl localhost:8000
  79. fi
  80. - |
  81. wget -qO - https://packages.couchbase.com/ubuntu/couchbase.key | sudo apt-key add -
  82. sudo apt-add-repository -y 'deb http://packages.couchbase.com/ubuntu trusty trusty/main'
  83. sudo apt-get update && sudo apt-get install -y libcouchbase-dev
  84. after_success:
  85. - .tox/$TRAVIS_PYTHON_VERSION/bin/coverage xml
  86. - .tox/$TRAVIS_PYTHON_VERSION/bin/codecov -e TOXENV
  87. install: travis_retry pip install -U tox | cat
  88. script: tox -v -- -v
  89. notifications:
  90. irc:
  91. channels:
  92. - "chat.freenode.net#celery"
  93. on_success: change
  94. on_failure: change
  95. services:
  96. - rabbitmq
  97. - redis