.travis.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. after_success:
  81. - .tox/$TRAVIS_PYTHON_VERSION/bin/coverage xml
  82. - .tox/$TRAVIS_PYTHON_VERSION/bin/codecov -e TOXENV
  83. install: travis_retry pip install -U tox | cat
  84. script: tox -v -- -v
  85. notifications:
  86. irc:
  87. channels:
  88. - "chat.freenode.net#celery"
  89. on_success: change
  90. on_failure: change
  91. services:
  92. - rabbitmq
  93. - redis