2
0

selenium.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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@v4
  22. with:
  23. python-version: '3.12'
  24. cache: 'pip'
  25. cache-dependency-path: 'tests/requirements/py3.txt'
  26. - name: Install and upgrade packaging tools
  27. run: python -m pip install --upgrade pip setuptools wheel
  28. - run: python -m pip install -r tests/requirements/py3.txt -e .
  29. - name: Run Selenium tests
  30. working-directory: ./tests/
  31. run: |
  32. python -Wall runtests.py --verbosity 2 --noinput --selenium=chrome --headless --settings=test_sqlite --parallel 2
  33. selenium-postgresql:
  34. if: contains(github.event.pull_request.labels.*.name, 'selenium')
  35. runs-on: ubuntu-latest
  36. name: PostgreSQL
  37. services:
  38. postgres:
  39. image: postgres:12-alpine
  40. env:
  41. POSTGRES_DB: django
  42. POSTGRES_USER: user
  43. POSTGRES_PASSWORD: postgres
  44. ports:
  45. - 5432:5432
  46. options: >-
  47. --health-cmd pg_isready
  48. --health-interval 10s
  49. --health-timeout 5s
  50. --health-retries 5
  51. steps:
  52. - name: Checkout
  53. uses: actions/checkout@v4
  54. - name: Set up Python
  55. uses: actions/setup-python@v4
  56. with:
  57. python-version: '3.12'
  58. cache: 'pip'
  59. cache-dependency-path: 'tests/requirements/py3.txt'
  60. - name: Install and upgrade packaging tools
  61. run: python -m pip install --upgrade pip setuptools wheel
  62. - run: python -m pip install -r tests/requirements/py3.txt -r tests/requirements/postgres.txt -e .
  63. - name: Create PostgreSQL settings file
  64. run: mv ./.github/workflows/data/test_postgres.py.tpl ./tests/test_postgres.py
  65. - name: Run Selenium tests
  66. working-directory: ./tests/
  67. run: |
  68. python -Wall runtests.py --verbosity 2 --noinput --selenium=chrome --headless --settings=test_postgres --parallel 2