backend-test-py3.6.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. MIGRATIONS_TEST_MIGRATE: 1
  17. steps:
  18. - uses: actions/checkout@v2
  19. # If we make these jobs "required" to merge on GH, then on every PR, GitHub automatically
  20. # creates a status check in the "pending" state. This means that the workflow needs to run
  21. # for every PR in order to update the status checks.
  22. #
  23. # In order to optimize CI usage, we want the tests to only run when python files change,
  24. # since frontend changes should have no effect on these test suites. We cannot use GH workflow
  25. # path filters because entire workflow would be skipped vs skipping individual jobs which
  26. # would still allow this status check to pass.
  27. - name: Check for python file changes
  28. uses: getsentry/paths-filter@v2
  29. id: changes
  30. with:
  31. token: ${{ github.token }}
  32. filters: .github/file-filters.yml
  33. - name: Set python version output
  34. id: python-version
  35. if: steps.changes.outputs.backend == 'true'
  36. run: |
  37. echo "::set-output name=python-version::$(awk 'FNR == 2' .python-version)"
  38. # Until GH composite actions can use `uses`, we need to setup python here
  39. - uses: actions/setup-python@v2
  40. if: steps.changes.outputs.backend == 'true'
  41. with:
  42. python-version: ${{ steps.python-version.outputs.python-version }}
  43. - name: Setup pip
  44. uses: ./.github/actions/setup-pip
  45. if: steps.changes.outputs.backend == 'true'
  46. id: pip
  47. - name: pip cache
  48. uses: actions/cache@v2
  49. if: steps.changes.outputs.backend == 'true'
  50. with:
  51. path: ${{ steps.pip.outputs.pip-cache-dir }}
  52. key: ${{ runner.os }}-pip-py${{ steps.python-version.outputs.python-version }}-${{ hashFiles('**/requirements-*.txt') }}
  53. restore-keys: |
  54. ${{ runner.os }}-pip-py${{ steps.python-version.outputs.python-version }}
  55. - name: Setup sentry env
  56. uses: ./.github/actions/setup-sentry
  57. if: steps.changes.outputs.backend == 'true'
  58. id: setup
  59. with:
  60. python: 3
  61. snuba: true
  62. - name: Run backend test [py3.6] (${{ steps.setup.outputs.matrix-instance-number }} of ${{ strategy.job-total }})
  63. if: steps.changes.outputs.backend == 'true'
  64. run: |
  65. make travis-test-postgres