schedule_tests.yml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. name: Schedule tests
  2. on:
  3. workflow_dispatch:
  4. concurrency:
  5. group: ${{ github.workflow }}-${{ github.ref }}
  6. cancel-in-progress: true
  7. permissions:
  8. contents: read
  9. jobs:
  10. windows:
  11. runs-on: windows-latest
  12. strategy:
  13. matrix:
  14. python-version:
  15. - '3.12'
  16. - '3.13'
  17. - '3.14-dev'
  18. name: Windows, SQLite, Python ${{ matrix.python-version }}
  19. continue-on-error: true
  20. steps:
  21. - name: Checkout
  22. uses: actions/checkout@v4
  23. - name: Set up Python
  24. uses: actions/setup-python@v5
  25. with:
  26. python-version: ${{ matrix.python-version }}
  27. cache: 'pip'
  28. cache-dependency-path: 'tests/requirements/py3.txt'
  29. - name: Install and upgrade packaging tools
  30. run: python -m pip install --upgrade pip setuptools wheel
  31. - run: python -m pip install -r tests/requirements/py3.txt -e .
  32. - name: Run tests
  33. run: python -Wall tests/runtests.py -v2
  34. pyc-only:
  35. runs-on: ubuntu-latest
  36. name: Byte-compiled Django with no source files (only .pyc files)
  37. steps:
  38. - name: Checkout
  39. uses: actions/checkout@v4
  40. - name: Set up Python
  41. uses: actions/setup-python@v5
  42. with:
  43. python-version: '3.13'
  44. cache: 'pip'
  45. - name: Install libmemcached-dev for pylibmc
  46. run: sudo apt-get install libmemcached-dev
  47. - name: Install and upgrade packaging tools
  48. run: python -m pip install --upgrade pip setuptools wheel
  49. - run: python -m pip install .
  50. - name: Prepare site-packages
  51. run: |
  52. DJANGO_PACKAGE_ROOT=$(python -c 'import site; print(site.getsitepackages()[0])')/django
  53. echo $DJANGO_PACKAGE_ROOT
  54. python -m compileall -b $DJANGO_PACKAGE_ROOT
  55. find $DJANGO_PACKAGE_ROOT -name '*.py' -print -delete
  56. - run: python -m pip install -r tests/requirements/py3.txt
  57. - name: Run tests
  58. run: python -Wall tests/runtests.py --verbosity=2
  59. javascript-tests:
  60. runs-on: ubuntu-latest
  61. name: JavaScript tests
  62. steps:
  63. - name: Checkout
  64. uses: actions/checkout@v4
  65. - name: Set up Node.js
  66. uses: actions/setup-node@v4
  67. with:
  68. node-version: '20'
  69. cache: 'npm'
  70. cache-dependency-path: '**/package.json'
  71. - run: npm install
  72. - run: npm test
  73. selenium-sqlite:
  74. runs-on: ubuntu-latest
  75. name: Selenium tests, SQLite
  76. steps:
  77. - name: Checkout
  78. uses: actions/checkout@v4
  79. - name: Set up Python
  80. uses: actions/setup-python@v5
  81. with:
  82. python-version: '3.13'
  83. cache: 'pip'
  84. cache-dependency-path: 'tests/requirements/py3.txt'
  85. - name: Install libmemcached-dev for pylibmc
  86. run: sudo apt-get install libmemcached-dev
  87. - name: Install and upgrade packaging tools
  88. run: python -m pip install --upgrade pip setuptools wheel
  89. - run: python -m pip install -r tests/requirements/py3.txt -e .
  90. - name: Run Selenium tests
  91. working-directory: ./tests/
  92. run: |
  93. python -Wall runtests.py --verbosity 2 --noinput --selenium=chrome --headless --settings=test_sqlite --parallel 2
  94. selenium-postgresql:
  95. runs-on: ubuntu-latest
  96. name: Selenium tests, PostgreSQL
  97. services:
  98. postgres:
  99. image: postgres:14-alpine
  100. env:
  101. POSTGRES_DB: django
  102. POSTGRES_USER: user
  103. POSTGRES_PASSWORD: postgres
  104. ports:
  105. - 5432:5432
  106. options: >-
  107. --health-cmd pg_isready
  108. --health-interval 10s
  109. --health-timeout 5s
  110. --health-retries 5
  111. steps:
  112. - name: Checkout
  113. uses: actions/checkout@v4
  114. - name: Set up Python
  115. uses: actions/setup-python@v5
  116. with:
  117. python-version: '3.13'
  118. cache: 'pip'
  119. cache-dependency-path: 'tests/requirements/py3.txt'
  120. - name: Install libmemcached-dev for pylibmc
  121. run: sudo apt-get install libmemcached-dev
  122. - name: Install and upgrade packaging tools
  123. run: python -m pip install --upgrade pip setuptools wheel
  124. - run: python -m pip install -r tests/requirements/py3.txt -r tests/requirements/postgres.txt -e .
  125. - name: Create PostgreSQL settings file
  126. run: mv ./.github/workflows/data/test_postgres.py.tpl ./tests/test_postgres.py
  127. - name: Run Selenium tests
  128. working-directory: ./tests/
  129. run: |
  130. python -Wall runtests.py --verbosity 2 --noinput --selenium=chrome --headless --settings=test_postgres --parallel 2
  131. postgresql:
  132. strategy:
  133. fail-fast: false
  134. matrix:
  135. version: [16, 17]
  136. server_side_bindings: [0, 1]
  137. runs-on: ubuntu-latest
  138. name: PostgreSQL Versions
  139. env:
  140. SERVER_SIDE_BINDING: ${{ matrix.server_side_bindings }}
  141. services:
  142. postgres:
  143. image: postgres:${{ matrix.version }}-alpine
  144. env:
  145. POSTGRES_DB: django
  146. POSTGRES_USER: user
  147. POSTGRES_PASSWORD: postgres
  148. ports:
  149. - 5432:5432
  150. options: >-
  151. --health-cmd pg_isready
  152. --health-interval 10s
  153. --health-timeout 5s
  154. --health-retries 5
  155. steps:
  156. - name: Checkout
  157. uses: actions/checkout@v4
  158. - name: Set up Python
  159. uses: actions/setup-python@v5
  160. with:
  161. python-version: '3.13'
  162. cache: 'pip'
  163. cache-dependency-path: 'tests/requirements/py3.txt'
  164. - name: Install libmemcached-dev for pylibmc
  165. run: sudo apt-get install libmemcached-dev
  166. - name: Install and upgrade packaging tools
  167. run: python -m pip install --upgrade pip setuptools wheel
  168. - run: python -m pip install -r tests/requirements/py3.txt -r tests/requirements/postgres.txt -e .
  169. - name: Create PostgreSQL settings file
  170. run: mv ./.github/workflows/data/test_postgres.py.tpl ./tests/test_postgres.py
  171. - name: Run tests
  172. working-directory: ./tests/
  173. run: python -Wall runtests.py --settings=test_postgres --verbosity=2