backend-typing.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. name: backend typing
  2. on:
  3. push:
  4. branches:
  5. - master
  6. pull_request:
  7. jobs:
  8. test:
  9. name: backend typing
  10. runs-on: ubuntu-20.04
  11. timeout-minutes: 12
  12. strategy:
  13. matrix:
  14. # TODO(joshuarli): Add 3.8.12.
  15. python-version: [3.6.13]
  16. steps:
  17. - uses: actions/checkout@v2
  18. # If we make these jobs "required" to merge on GH, then on every PR, GitHub automatically
  19. # creates a status check in the "pending" state. This means that the workflow needs to run
  20. # for every PR in order to update the status checks.
  21. #
  22. # In order to optimize CI usage, we want the tests to only run when python files change,
  23. # since frontend changes should have no effect on these test suites. We cannot use GH workflow
  24. # path filters because entire workflow would be skipped vs skipping individual jobs which
  25. # would still allow this status check to pass.
  26. - name: Check for python file changes
  27. uses: getsentry/paths-filter@v2
  28. id: changes
  29. with:
  30. token: ${{ github.token }}
  31. filters: .github/file-filters.yml
  32. - name: Setup Python ${{ matrix.python-version }}
  33. uses: ./.github/actions/setup-python
  34. if: steps.changes.outputs.backend == 'true'
  35. with:
  36. python-version: ${{ matrix.python-version }}
  37. # Since we don't call the setup-sentry action we need to install libxmlsec1-dev
  38. - name: Setup backend typing
  39. if: steps.changes.outputs.backend == 'true'
  40. env:
  41. SENTRY_LIGHT_BUILD: 1
  42. run: |
  43. sudo apt-get update
  44. sudo apt-get install -y --no-install-recommends libxmlsec1-dev
  45. python setup.py install_egg_info
  46. pip install wheel # GitHub Actions does not have `wheel` installed by default
  47. pip install -U -e ".[dev]"
  48. - name: Run backend typing (${{ steps.setup.outputs.matrix-instance-number }} of ${{ strategy.job-total }})
  49. if: steps.changes.outputs.backend == 'true'
  50. run: |
  51. make backend-typing