test.yml 11 KB

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