db-migration-test.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. name: DB Migration Test
  2. on:
  3. pull_request:
  4. branches:
  5. - main
  6. paths:
  7. - api/migrations/**
  8. - .github/workflows/db-migration-test.yml
  9. concurrency:
  10. group: db-migration-test-${{ github.ref }}
  11. cancel-in-progress: true
  12. jobs:
  13. db-migration-test:
  14. runs-on: ubuntu-latest
  15. steps:
  16. - name: Checkout code
  17. uses: actions/checkout@v4
  18. - name: Setup Poetry and Python
  19. uses: ./.github/actions/setup-poetry
  20. with:
  21. poetry-lockfile: api/poetry.lock
  22. - name: Install dependencies
  23. run: poetry install -C api
  24. - name: Prepare middleware env
  25. run: |
  26. cd docker
  27. cp middleware.env.example middleware.env
  28. - name: Set up Middlewares
  29. uses: hoverkraft-tech/compose-action@v2.0.2
  30. with:
  31. compose-file: |
  32. docker/docker-compose.middleware.yaml
  33. services: |
  34. db
  35. redis
  36. - name: Prepare configs
  37. run: |
  38. cd api
  39. cp .env.example .env
  40. - name: Run DB Migration
  41. env:
  42. DEBUG: true
  43. run: |
  44. cd api
  45. poetry run python -m flask upgrade-db