test.yml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. name: Wagtail CI
  2. on:
  3. push:
  4. pull_request:
  5. # Our test suite should cover:
  6. # - all supported databases against current Python and Django
  7. # - at least one test run for each older supported version of Python and Django
  8. # - at least one test run for each supported Elasticsearch version
  9. # - a test run against Django's git master and active stable branch (allowing failures)
  10. # - test runs with USE_EMAIL_USER_MODEL=yes and DISABLE_TIMEZONE=yes
  11. # Current configuration:
  12. # - django 2.2, python 3.6, mysql
  13. # - django 3.0, python 3.7, sqlite
  14. # - django 3.1, python 3.8, postgres
  15. # - django 3.1, python 3.9, mysql
  16. # - django 3.1, python 3.9, sqlite
  17. # - django 3.1, python 3.9, postgres, USE_EMAIL_USER_MODEL=yes
  18. # - django 3.1, python 3.9, postgres, DISABLE_TIMEZONE=yes
  19. # - django stable/3.1.x, python 3.9, postgres (allow failures)
  20. # - django master, python 3.9, postgres (allow failures)
  21. # - elasticsearch 5, django 2.2, python 3.6, sqlite
  22. # - elasticsearch 6, django 3.0, python 3.7, postgres
  23. # - elasticsearch 7, django 3.1, python 3.8, postgres
  24. # - elasticsearch 7, django 3.1, python 3.9, sqlite, USE_EMAIL_USER_MODEL=yes
  25. jobs:
  26. test-sqlite:
  27. runs-on: ubuntu-latest
  28. strategy:
  29. matrix:
  30. include:
  31. - python: 3.7
  32. django: "Django>=3.0,<3.1"
  33. - python: 3.9
  34. django: "Django>=3.1,<3.2"
  35. steps:
  36. - uses: actions/checkout@v2
  37. - name: Set up Python ${{ matrix.python }}
  38. uses: actions/setup-python@v2
  39. with:
  40. python-version: ${{ matrix.python }}
  41. - name: Install dependencies
  42. run: |
  43. python -m pip install --upgrade pip
  44. pip install "${{ matrix.django }}"
  45. pip install -e .[testing]
  46. - name: Test
  47. run: |
  48. ./runtests.py
  49. env:
  50. DATABASE_ENGINE: django.db.backends.sqlite3
  51. test-postgres:
  52. runs-on: ubuntu-latest
  53. continue-on-error: ${{ matrix.experimental }}
  54. strategy:
  55. matrix:
  56. include:
  57. - python: 3.8
  58. django: "Django>=3.1,<3.2"
  59. experimental: false
  60. - python: 3.9
  61. django: "Django>=3.1,<3.2"
  62. emailuser: emailuser
  63. experimental: false
  64. - python: 3.9
  65. django: "Django>=3.1,<3.2"
  66. notz: notz
  67. experimental: false
  68. - python: 3.9
  69. django: "git+https://github.com/django/django.git@stable/3.1.x#egg=Django"
  70. experimental: true
  71. - python: 3.9
  72. django: "git+https://github.com/django/django.git@master#egg=Django"
  73. experimental: true
  74. services:
  75. postgres:
  76. image: postgres:10.8
  77. ports:
  78. - 5432:5432
  79. options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
  80. steps:
  81. - uses: actions/checkout@v2
  82. - name: Set up Python ${{ matrix.python }}
  83. uses: actions/setup-python@v2
  84. with:
  85. python-version: ${{ matrix.python }}
  86. - name: Install dependencies
  87. run: |
  88. python -m pip install --upgrade pip
  89. pip install "psycopg2>=2.6"
  90. pip install "${{ matrix.django }}"
  91. pip install -e .[testing]
  92. - name: Test
  93. run: |
  94. ./runtests.py
  95. env:
  96. DATABASE_ENGINE: django.db.backends.postgresql
  97. DATABASE_HOST: localhost
  98. DATABASE_USER: postgres
  99. DATABASE_PASS: postgres
  100. USE_EMAIL_USER_MODEL: ${{ matrix.emailuser }}
  101. DISABLE_TIMEZONE: ${{ matrix.notz }}
  102. test-mysql:
  103. runs-on: ubuntu-latest
  104. strategy:
  105. matrix:
  106. include:
  107. - python: 3.6
  108. django: "Django>=2.2,<3.0"
  109. - python: 3.9
  110. django: "Django>=3.1,<3.2"
  111. services:
  112. mysql:
  113. image: mysql:5.7
  114. env:
  115. MYSQL_ALLOW_EMPTY_PASSWORD: yes
  116. MYSQL_DATABASE: wagtail
  117. ports:
  118. - 3306:3306
  119. options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
  120. steps:
  121. - uses: actions/checkout@v2
  122. - name: Set up Python ${{ matrix.python }}
  123. uses: actions/setup-python@v2
  124. with:
  125. python-version: ${{ matrix.python }}
  126. - name: Install dependencies
  127. run: |
  128. python -m pip install --upgrade pip
  129. pip install "mysqlclient>=1.4,<2"
  130. pip install "${{ matrix.django }}"
  131. pip install -e .[testing]
  132. - name: Test
  133. run: |
  134. ./runtests.py
  135. env:
  136. DATABASE_ENGINE: django.db.backends.mysql
  137. DATABASE_HOST: "127.0.0.1"
  138. DATABASE_USER: root
  139. # https://github.com/elastic/elastic-github-actions doesn't work for Elasticsearch 5,
  140. # but https://github.com/getong/elasticsearch-action does
  141. test-sqlite-elasticsearch5:
  142. runs-on: ubuntu-latest
  143. strategy:
  144. matrix:
  145. include:
  146. - python: 3.6
  147. django: "Django>=2.2,<3.0"
  148. steps:
  149. - name: Configure sysctl limits
  150. run: |
  151. sudo swapoff -a
  152. sudo sysctl -w vm.swappiness=1
  153. sudo sysctl -w fs.file-max=262144
  154. sudo sysctl -w vm.max_map_count=262144
  155. - uses: getong/elasticsearch-action@v1.2
  156. with:
  157. elasticsearch version: 5.6.9
  158. host port: 9200
  159. container port: 9200
  160. host node port: 9300
  161. node port: 9300
  162. discovery type: 'single-node'
  163. - uses: actions/checkout@v2
  164. - name: Set up Python ${{ matrix.python }}
  165. uses: actions/setup-python@v2
  166. with:
  167. python-version: ${{ matrix.python }}
  168. - name: Install dependencies
  169. run: |
  170. python -m pip install --upgrade pip
  171. pip install "${{ matrix.django }}"
  172. pip install -e .[testing]
  173. pip install "elasticsearch>=5,<6"
  174. pip install certifi
  175. - name: Test
  176. run: |
  177. ./runtests.py wagtail.search wagtail.documents wagtail.images --elasticsearch5
  178. env:
  179. DATABASE_ENGINE: django.db.backends.sqlite3
  180. test-sqlite-elasticsearch7:
  181. runs-on: ubuntu-latest
  182. strategy:
  183. matrix:
  184. include:
  185. - python: 3.9
  186. django: "Django>=3.1,<3.2"
  187. emailuser: emailuser
  188. steps:
  189. - name: Configure sysctl limits
  190. run: |
  191. sudo swapoff -a
  192. sudo sysctl -w vm.swappiness=1
  193. sudo sysctl -w fs.file-max=262144
  194. sudo sysctl -w vm.max_map_count=262144
  195. - uses: getong/elasticsearch-action@v1.2
  196. with:
  197. elasticsearch version: 7.6.1
  198. host port: 9200
  199. container port: 9200
  200. host node port: 9300
  201. node port: 9300
  202. discovery type: 'single-node'
  203. - uses: actions/checkout@v2
  204. - name: Set up Python ${{ matrix.python }}
  205. uses: actions/setup-python@v2
  206. with:
  207. python-version: ${{ matrix.python }}
  208. - name: Install dependencies
  209. run: |
  210. python -m pip install --upgrade pip
  211. pip install "${{ matrix.django }}"
  212. pip install -e .[testing]
  213. pip install "elasticsearch>=7,<8"
  214. pip install certifi
  215. - name: Test
  216. run: |
  217. ./runtests.py wagtail.search wagtail.documents wagtail.images --elasticsearch7
  218. env:
  219. DATABASE_ENGINE: django.db.backends.sqlite3
  220. USE_EMAIL_USER_MODEL: ${{ matrix.emailuser }}
  221. # https://github.com/getong/elasticsearch-action doesn't work for Elasticsearch 6,
  222. # but https://github.com/elastic/elastic-github-actions does
  223. test-postgres-elasticsearch6:
  224. runs-on: ubuntu-latest
  225. strategy:
  226. matrix:
  227. include:
  228. - python: 3.7
  229. django: "Django>=3.0,<3.1"
  230. services:
  231. postgres:
  232. image: postgres:10.8
  233. ports:
  234. - 5432:5432
  235. options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
  236. steps:
  237. - name: Configure sysctl limits
  238. run: |
  239. sudo swapoff -a
  240. sudo sysctl -w vm.swappiness=1
  241. sudo sysctl -w fs.file-max=262144
  242. sudo sysctl -w vm.max_map_count=262144
  243. - uses: elastic/elastic-github-actions/elasticsearch@master
  244. with:
  245. stack-version: 6.8.13
  246. - uses: actions/checkout@v2
  247. - name: Set up Python ${{ matrix.python }}
  248. uses: actions/setup-python@v2
  249. with:
  250. python-version: ${{ matrix.python }}
  251. - name: Install dependencies
  252. run: |
  253. python -m pip install --upgrade pip
  254. pip install "psycopg2>=2.6"
  255. pip install "${{ matrix.django }}"
  256. pip install -e .[testing]
  257. pip install "elasticsearch>=6,<7"
  258. pip install certifi
  259. - name: Test
  260. run: |
  261. ./runtests.py wagtail.search wagtail.documents wagtail.images --elasticsearch6
  262. env:
  263. DATABASE_ENGINE: django.db.backends.postgresql
  264. DATABASE_HOST: localhost
  265. DATABASE_USER: postgres
  266. DATABASE_PASS: postgres
  267. USE_EMAIL_USER_MODEL: ${{ matrix.emailuser }}
  268. test-postgres-elasticsearch7:
  269. runs-on: ubuntu-latest
  270. strategy:
  271. matrix:
  272. include:
  273. - python: 3.8
  274. django: "Django>=3.1,<3.2"
  275. services:
  276. postgres:
  277. image: postgres:10.8
  278. ports:
  279. - 5432:5432
  280. options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
  281. steps:
  282. - name: Configure sysctl limits
  283. run: |
  284. sudo swapoff -a
  285. sudo sysctl -w vm.swappiness=1
  286. sudo sysctl -w fs.file-max=262144
  287. sudo sysctl -w vm.max_map_count=262144
  288. - uses: elastic/elastic-github-actions/elasticsearch@master
  289. with:
  290. stack-version: 7.6.1
  291. - uses: actions/checkout@v2
  292. - name: Set up Python ${{ matrix.python }}
  293. uses: actions/setup-python@v2
  294. with:
  295. python-version: ${{ matrix.python }}
  296. - name: Install dependencies
  297. run: |
  298. python -m pip install --upgrade pip
  299. pip install "psycopg2>=2.6"
  300. pip install "${{ matrix.django }}"
  301. pip install -e .[testing]
  302. pip install "elasticsearch>=7,<8"
  303. pip install certifi
  304. - name: Test
  305. run: |
  306. ./runtests.py wagtail.search wagtail.documents wagtail.images --elasticsearch7
  307. env:
  308. DATABASE_ENGINE: django.db.backends.postgresql
  309. DATABASE_HOST: localhost
  310. DATABASE_USER: postgres
  311. DATABASE_PASS: postgres
  312. USE_EMAIL_USER_MODEL: ${{ matrix.emailuser }}