.travis.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. sudo: false
  2. language: python
  3. cache:
  4. directories:
  5. # we only bother to cache the wheels; parts of the http cache get
  6. # invalidated every build (because they get served with a max-age of 600
  7. # seconds), which means that we end up re-uploading the whole cache for
  8. # every build, which is time-consuming In any case, it's not obvious that
  9. # downloading the cache from S3 would be much faster than downloading the
  10. # originals from pypi.
  11. #
  12. - $HOME/.cache/pip/wheels
  13. addons:
  14. postgresql: "9.4"
  15. # don't clone the whole repo history, one commit will do
  16. git:
  17. depth: 1
  18. # only build branches we care about (PRs are built seperately)
  19. branches:
  20. only:
  21. - master
  22. - develop
  23. - /^release-v/
  24. # When running the tox environments that call Twisted Trial, we can pass the -j
  25. # flag to run the tests concurrently. We set this to 2 for CPU bound tests
  26. # (SQLite) and 4 for I/O bound tests (PostgreSQL).
  27. matrix:
  28. fast_finish: true
  29. include:
  30. - python: 2.7
  31. env: TOX_ENV=packaging
  32. - python: 3.6
  33. env: TOX_ENV="pep8,check_isort"
  34. - python: 2.7
  35. env: TOX_ENV=py27,codecov TRIAL_FLAGS="-j 2"
  36. - python: 2.7
  37. env: TOX_ENV=py27-old TRIAL_FLAGS="-j 2"
  38. - python: 2.7
  39. env: TOX_ENV=py27-postgres,codecov TRIAL_FLAGS="-j 4"
  40. services:
  41. - postgresql
  42. - python: 3.5
  43. env: TOX_ENV=py35,codecov TRIAL_FLAGS="-j 2"
  44. - python: 3.6
  45. env: TOX_ENV=py36,codecov TRIAL_FLAGS="-j 2"
  46. - python: 3.6
  47. env: TOX_ENV=py36-postgres,codecov TRIAL_FLAGS="-j 4"
  48. services:
  49. - postgresql
  50. - # we only need to check for the newsfragment if it's a PR build
  51. if: type = pull_request
  52. python: 3.6
  53. env: TOX_ENV=check-newsfragment
  54. script:
  55. - git remote set-branches --add origin develop
  56. - git fetch origin develop
  57. - tox -e $TOX_ENV
  58. install:
  59. - pip install tox
  60. # if we don't have python3.6 in this environment, travis unhelpfully gives us
  61. # a `python3.6` on our path which does nothing but spit out a warning. Tox
  62. # tries to run it (even if we're not running a py36 env), so the build logs
  63. # then have warnings which look like errors. To reduce the noise, remove the
  64. # non-functional python3.6.
  65. - ( ! command -v python3.6 || python3.6 --version ) &>/dev/null || rm -f $(command -v python3.6)
  66. script:
  67. - tox -e $TOX_ENV