.travis.yml 3.3 KB

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