db-migration-test.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. name: DB Migration Test
  2. on:
  3. pull_request:
  4. branches:
  5. - main
  6. paths:
  7. - api/migrations/**
  8. concurrency:
  9. group: db-migration-test-${{ github.ref }}
  10. cancel-in-progress: true
  11. jobs:
  12. db-migration-test:
  13. runs-on: ubuntu-latest
  14. strategy:
  15. matrix:
  16. python-version:
  17. - "3.10"
  18. steps:
  19. - name: Checkout code
  20. uses: actions/checkout@v4
  21. - name: Set up Python ${{ matrix.python-version }}
  22. uses: actions/setup-python@v5
  23. with:
  24. python-version: ${{ matrix.python-version }}
  25. cache: 'pip'
  26. cache-dependency-path: |
  27. ./api/requirements.txt
  28. - name: Install dependencies
  29. run: pip install -r ./api/requirements.txt
  30. - name: Set up Middleware
  31. uses: hoverkraft-tech/compose-action@v2.0.0
  32. with:
  33. compose-file: |
  34. docker/docker-compose.middleware.yaml
  35. services: |
  36. db
  37. - name: Prepare configs
  38. run: |
  39. cd api
  40. cp .env.example .env
  41. - name: Run DB Migration
  42. run: |
  43. cd api
  44. flask db upgrade