db-migration-test.yml 1.2 KB

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