.travis.yml 2.8 KB

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