backend-typing.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. steps:
  13. - uses: actions/checkout@v2
  14. # If we make these jobs "required" to merge on GH, then on every PR, GitHub automatically
  15. # creates a status check in the "pending" state. This means that the workflow needs to run
  16. # for every PR in order to update the status checks.
  17. #
  18. # In order to optimize CI usage, we want the tests to only run when python files change,
  19. # since frontend changes should have no effect on these test suites. We cannot use GH workflow
  20. # path filters because entire workflow would be skipped vs skipping individual jobs which
  21. # would still allow this status check to pass.
  22. - name: Check for python file changes
  23. uses: getsentry/paths-filter@v2
  24. id: changes
  25. with:
  26. token: ${{ github.token }}
  27. filters: .github/file-filters.yml
  28. - name: Set python version output
  29. id: python-version
  30. if: steps.changes.outputs.backend == 'true'
  31. run: |
  32. echo "::set-output name=python-version::$(cat .python-version)"
  33. # Until GH composite actions can use `uses`, we need to setup python here
  34. - uses: actions/setup-python@v2
  35. if: steps.changes.outputs.backend == 'true'
  36. with:
  37. python-version: ${{ steps.python-version.outputs.python-version }}
  38. - name: Setup pip
  39. uses: ./.github/actions/setup-pip
  40. if: steps.changes.outputs.backend == 'true'
  41. id: pip
  42. - name: pip cache
  43. uses: actions/cache@v2
  44. if: steps.changes.outputs.backend == 'true'
  45. with:
  46. path: ${{ steps.pip.outputs.pip-cache-dir }}
  47. key: |
  48. ${{ runner.os }}-py${{ steps.python-version.outputs.python-version }}-pip${{ steps.pip.outputs.pip-version }}-${{ secrets.PIP_CACHE_VERSION }}-${{ hashFiles('requirements-*.txt', '!requirements-pre-commit.txt') }}
  49. # Since we don't call the setup-sentry action we need to install libxmlsec1-dev
  50. - name: Setup backend typing
  51. if: steps.changes.outputs.backend == 'true'
  52. env:
  53. SENTRY_LIGHT_BUILD: 1
  54. run: |
  55. sudo apt-get update
  56. sudo apt-get install -y --no-install-recommends libxmlsec1-dev
  57. python setup.py install_egg_info
  58. pip install wheel # GitHub Actions does not have `wheel` installed by default
  59. pip install -U -e ".[dev]"
  60. - name: Run backend typing (${{ steps.setup.outputs.matrix-instance-number }} of ${{ strategy.job-total }})
  61. if: steps.changes.outputs.backend == 'true'
  62. run: |
  63. make backend-typing