check-if-migration-is-required.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. name: check migration
  2. on: pull_request
  3. jobs:
  4. should-check:
  5. name: did files change
  6. runs-on: ubuntu-20.04
  7. timeout-minutes: 90
  8. # Map a step output to a job output
  9. outputs:
  10. changed: ${{ steps.changes.outputs.migration_lockfile }}
  11. steps:
  12. - name: Checkout sentry
  13. uses: actions/checkout@v2
  14. - name: check if files have changed
  15. uses: getsentry/paths-filter@v2
  16. id: changes
  17. with:
  18. token: ${{ github.token }}
  19. filters: .github/file-filters.yml
  20. main:
  21. name: check migration
  22. runs-on: ubuntu-20.04
  23. strategy:
  24. matrix:
  25. python-version: [3.8.12]
  26. needs: [should-check]
  27. steps:
  28. - name: Checkout sentry
  29. uses: actions/checkout@v2
  30. if: needs.should-check.outputs.changed == 'true'
  31. - name: Setup sentry env (python ${{ matrix.python-version }})
  32. uses: ./.github/actions/setup-sentry
  33. if: needs.should-check.outputs.changed == 'true'
  34. id: setup
  35. with:
  36. python-version: ${{ matrix.python-version }}
  37. pip-cache-version: ${{ secrets.PIP_CACHE_VERSION }}
  38. - name: Migration & lockfile checks
  39. if: needs.should-check.outputs.changed == 'true'
  40. env:
  41. SENTRY_LOG_LEVEL: ERROR
  42. PGPASSWORD: postgres
  43. run: |
  44. ./.github/workflows/scripts/migration-check.sh