django-tests.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. name: Run Python Tests
  2. on:
  3. push:
  4. branches: [ main ]
  5. pull_request:
  6. branches: [ main ]
  7. jobs:
  8. build:
  9. runs-on: ubuntu-20.04
  10. services:
  11. postgres:
  12. image: postgres:13
  13. env:
  14. POSTGRES_USER: postgres
  15. POSTGRES_PASSWORD: hunter2
  16. options: >-
  17. --health-cmd pg_isready
  18. --health-interval 10s
  19. --health-timeout 5s
  20. --health-retries 5
  21. ports:
  22. - 5432:5432
  23. steps:
  24. - uses: actions/checkout@v3
  25. - name: Set up Python
  26. uses: actions/setup-python@v4
  27. with:
  28. python-version: 3.9
  29. - name: Install Dependencies
  30. run: |
  31. python -m pip install --upgrade pip
  32. pip install -r requirements.txt
  33. - name: Check migrations up-to-date
  34. run: |
  35. python ./manage.py makemigrations --check
  36. env:
  37. SECRET_KEY: beepbeep
  38. DOMAIN: your.domain.here
  39. EMAIL_HOST: ""
  40. EMAIL_HOST_USER: ""
  41. EMAIL_HOST_PASSWORD: ""
  42. - name: Run Tests
  43. env:
  44. SECRET_KEY: beepbeep
  45. DEBUG: false
  46. USE_HTTPS: true
  47. DOMAIN: your.domain.here
  48. BOOKWYRM_DATABASE_BACKEND: postgres
  49. MEDIA_ROOT: images/
  50. POSTGRES_PASSWORD: hunter2
  51. POSTGRES_USER: postgres
  52. POSTGRES_DB: github_actions
  53. POSTGRES_HOST: 127.0.0.1
  54. CELERY_BROKER: ""
  55. REDIS_BROKER_PORT: 6379
  56. REDIS_BROKER_PASSWORD: beep
  57. USE_DUMMY_CACHE: true
  58. FLOWER_PORT: 8888
  59. EMAIL_HOST: "smtp.mailgun.org"
  60. EMAIL_PORT: 587
  61. EMAIL_HOST_USER: ""
  62. EMAIL_HOST_PASSWORD: ""
  63. EMAIL_USE_TLS: true
  64. ENABLE_PREVIEW_IMAGES: false
  65. ENABLE_THUMBNAIL_GENERATION: true
  66. HTTP_X_FORWARDED_PROTO: false
  67. run: |
  68. pytest -n 3