backend-test-py3.6.yml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. name: backend [py3.6]
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - releases/**
  7. pull_request:
  8. jobs:
  9. test:
  10. runs-on: ubuntu-16.04
  11. timeout-minutes: 30
  12. strategy:
  13. matrix:
  14. instance: [0, 1, 2]
  15. env:
  16. # Note: `USE_SNUBA` is not used for backend tests because there are a few failing tests with Snuba enabled.
  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. - name: Set python version output
  35. id: python-version
  36. if: steps.changes.outputs.backend == 'true'
  37. run: |
  38. echo "::set-output name=python-version::$(awk 'FNR == 2' .python-version)"
  39. # Until GH composite actions can use `uses`, we need to setup python here
  40. - uses: actions/setup-python@v2
  41. if: steps.changes.outputs.backend == 'true'
  42. with:
  43. python-version: ${{ steps.python-version.outputs.python-version }}
  44. - name: Setup pip
  45. uses: ./.github/actions/setup-pip
  46. if: steps.changes.outputs.backend == 'true'
  47. id: pip
  48. - name: pip cache
  49. uses: actions/cache@v2
  50. if: steps.changes.outputs.backend == 'true'
  51. with:
  52. path: ${{ steps.pip.outputs.pip-cache-dir }}
  53. key: ${{ runner.os }}-pip-py${{ steps.python-version.outputs.python-version }}-${{ hashFiles('**/requirements-*.txt') }}
  54. restore-keys: |
  55. ${{ runner.os }}-pip-py${{ steps.python-version.outputs.python-version }}
  56. - name: Setup sentry env
  57. uses: ./.github/actions/setup-sentry
  58. if: steps.changes.outputs.backend == 'true'
  59. id: setup
  60. with:
  61. python: 3
  62. snuba: true
  63. - name: Run backend test [py3.6] (${{ steps.setup.outputs.matrix-instance-number }} of ${{ strategy.job-total }})
  64. if: steps.changes.outputs.backend == 'true'
  65. run: |
  66. make travis-test-postgres