test.yml 10 KB

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