selenium.yml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. name: Selenium Tests
  2. on:
  3. pull_request:
  4. types: [labeled, synchronize, opened, reopened]
  5. paths-ignore:
  6. - 'docs/**'
  7. concurrency:
  8. group: ${{ github.workflow }}-${{ github.ref }}
  9. cancel-in-progress: true
  10. permissions:
  11. contents: read
  12. jobs:
  13. selenium-sqlite:
  14. if: contains(github.event.pull_request.labels.*.name, 'selenium')
  15. runs-on: ubuntu-latest
  16. name: SQLite
  17. steps:
  18. - name: Checkout
  19. uses: actions/checkout@v4
  20. - name: Set up Python
  21. uses: actions/setup-python@v5
  22. with:
  23. python-version: '3.13'
  24. cache: 'pip'
  25. cache-dependency-path: 'tests/requirements/py3.txt'
  26. - name: Install libmemcached-dev for pylibmc
  27. run: sudo apt-get install libmemcached-dev
  28. - name: Install and upgrade packaging tools
  29. run: python -m pip install --upgrade pip setuptools wheel
  30. - run: python -m pip install -r tests/requirements/py3.txt -e .
  31. - name: Run Selenium tests
  32. working-directory: ./tests/
  33. run: |
  34. python -Wall runtests.py --verbosity 2 --noinput --selenium=chrome --headless --settings=test_sqlite --parallel 2
  35. selenium-postgresql:
  36. if: contains(github.event.pull_request.labels.*.name, 'selenium')
  37. runs-on: ubuntu-latest
  38. name: PostgreSQL
  39. services:
  40. postgres:
  41. image: postgres:14-alpine
  42. env:
  43. POSTGRES_DB: django
  44. POSTGRES_USER: user
  45. POSTGRES_PASSWORD: postgres
  46. ports:
  47. - 5432:5432
  48. options: >-
  49. --health-cmd pg_isready
  50. --health-interval 10s
  51. --health-timeout 5s
  52. --health-retries 5
  53. steps:
  54. - name: Checkout
  55. uses: actions/checkout@v4
  56. - name: Set up Python
  57. uses: actions/setup-python@v5
  58. with:
  59. python-version: '3.13'
  60. cache: 'pip'
  61. cache-dependency-path: 'tests/requirements/py3.txt'
  62. - name: Install libmemcached-dev for pylibmc
  63. run: sudo apt-get install libmemcached-dev
  64. - name: Install and upgrade packaging tools
  65. run: python -m pip install --upgrade pip setuptools wheel
  66. - run: python -m pip install -r tests/requirements/py3.txt -r tests/requirements/postgres.txt -e .
  67. - name: Create PostgreSQL settings file
  68. run: mv ./.github/workflows/data/test_postgres.py.tpl ./tests/test_postgres.py
  69. - name: Run Selenium tests
  70. working-directory: ./tests/
  71. run: |
  72. python -Wall runtests.py --verbosity 2 --noinput --selenium=chrome --headless --settings=test_postgres --parallel 2