backend-test-py2.7.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. name: backend
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - releases/**
  7. pull_request:
  8. jobs:
  9. test:
  10. name: backend test
  11. runs-on: ubuntu-16.04
  12. timeout-minutes: 20
  13. strategy:
  14. matrix:
  15. instance: [0, 1, 2]
  16. env:
  17. MIGRATIONS_TEST_MIGRATE: 1
  18. steps:
  19. - uses: actions/checkout@v2
  20. # If we make these jobs "required" to merge on GH, then on every PR, GitHub automatically
  21. # creates a status check in the "pending" state. This means that the workflow needs to run
  22. # for every PR in order to update the status checks.
  23. #
  24. # In order to optimize CI usage, we want the tests to only run when python files change,
  25. # since frontend changes should have no effect on these test suites. We cannot use GH workflow
  26. # path filters because entire workflow would be skipped vs skipping individual jobs which
  27. # would still allow this status check to pass.
  28. - name: Check for python file changes
  29. uses: getsentry/paths-filter@v2
  30. id: changes
  31. with:
  32. token: ${{ github.token }}
  33. filters: .github/file-filters.yml
  34. # Until GH composite actions can use `uses`, we need to setup python here
  35. - uses: actions/setup-python@v2
  36. if: steps.changes.outputs.backend == 'true'
  37. with:
  38. python-version: 2.7.17
  39. - name: Setup pip
  40. uses: ./.github/actions/setup-pip
  41. id: pip
  42. if: steps.changes.outputs.backend == 'true'
  43. - name: pip cache
  44. uses: actions/cache@v2
  45. if: steps.changes.outputs.backend == 'true'
  46. with:
  47. path: ${{ steps.pip.outputs.pip-cache-dir }}
  48. key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-*.txt') }}
  49. restore-keys: |
  50. ${{ runner.os }}-pip-
  51. - name: Setup sentry env
  52. uses: ./.github/actions/setup-sentry
  53. id: setup
  54. if: steps.changes.outputs.backend == 'true'
  55. with:
  56. python: 2
  57. snuba: true
  58. - name: Run backend test [py2.7] (${{ steps.setup.outputs.matrix-instance-number }} of ${{ strategy.job-total }})
  59. if: steps.changes.outputs.backend == 'true'
  60. run: |
  61. # Note: `USE_SNUBA` is not used for backend tests because there are a few failing tests with Snuba enabled.
  62. unset USE_SNUBA
  63. make travis-test-postgres