.travis.yml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. dist: xenial
  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. # don't clone the whole repo history, one commit will do
  14. git:
  15. depth: 1
  16. # only build branches we care about (PRs are built seperately)
  17. branches:
  18. only:
  19. - master
  20. - develop
  21. - /^release-v/
  22. - rav/pg95
  23. # When running the tox environments that call Twisted Trial, we can pass the -j
  24. # flag to run the tests concurrently. We set this to 2 for CPU bound tests
  25. # (SQLite) and 4 for I/O bound tests (PostgreSQL).
  26. matrix:
  27. fast_finish: true
  28. include:
  29. - name: "pep8"
  30. python: 3.6
  31. env: TOX_ENV="pep8,check_isort,packaging"
  32. - name: "py2.7 / sqlite"
  33. python: 2.7
  34. env: TOX_ENV=py27,codecov TRIAL_FLAGS="-j 2"
  35. - name: "py2.7 / sqlite / olddeps"
  36. python: 2.7
  37. env: TOX_ENV=py27-old TRIAL_FLAGS="-j 2"
  38. - name: "py2.7 / postgres9.5"
  39. python: 2.7
  40. addons:
  41. postgresql: "9.5"
  42. env: TOX_ENV=py27-postgres,codecov TRIAL_FLAGS="-j 4"
  43. services:
  44. - postgresql
  45. - name: "py3.5 / sqlite"
  46. python: 3.5
  47. env: TOX_ENV=py35,codecov TRIAL_FLAGS="-j 2"
  48. - name: "py3.7 / sqlite"
  49. python: 3.7
  50. env: TOX_ENV=py37,codecov TRIAL_FLAGS="-j 2"
  51. - name: "py3.7 / postgres9.4"
  52. python: 3.7
  53. addons:
  54. postgresql: "9.4"
  55. env: TOX_ENV=py37-postgres TRIAL_FLAGS="-j 4"
  56. services:
  57. - postgresql
  58. - name: "py3.7 / postgres9.5"
  59. python: 3.7
  60. addons:
  61. postgresql: "9.5"
  62. env: TOX_ENV=py37-postgres,codecov TRIAL_FLAGS="-j 4"
  63. services:
  64. - postgresql
  65. - # we only need to check for the newsfragment if it's a PR build
  66. if: type = pull_request
  67. name: "check-newsfragment"
  68. python: 3.6
  69. script: scripts-dev/check-newsfragment
  70. install:
  71. # this just logs the postgres version we will be testing against (if any)
  72. - psql -At -U postgres -c 'select version();' || true
  73. - pip install tox
  74. # if we don't have python3.6 in this environment, travis unhelpfully gives us
  75. # a `python3.6` on our path which does nothing but spit out a warning. Tox
  76. # tries to run it (even if we're not running a py36 env), so the build logs
  77. # then have warnings which look like errors. To reduce the noise, remove the
  78. # non-functional python3.6.
  79. - ( ! command -v python3.6 || python3.6 --version ) &>/dev/null || rm -f $(command -v python3.6)
  80. script:
  81. - tox -e $TOX_ENV