acceptance-py3.6.yml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. name: acceptance [py3.6]
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - releases/**
  7. pull_request:
  8. jobs:
  9. py3-acceptance:
  10. name: python3.6 acceptance
  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. TEST_GROUP_STRATEGY: roundrobin
  19. steps:
  20. - uses: actions/checkout@v2
  21. - uses: volta-cli/action@v1
  22. # If we make these jobs "required" to merge on GH, then on every PR, GitHub automatically
  23. # creates a status check in the "pending" state. This means that the workflow needs to run
  24. # for every PR in order to update the status checks.
  25. #
  26. # In order to optimize CI usage, we want the tests to only run when python files change,
  27. # since frontend changes should have no effect on these test suites. We cannot use GH workflow
  28. # path filters because entire workflow would be skipped vs skipping individual jobs which
  29. # would still allow this status check to pass.
  30. - name: Check for python file changes
  31. uses: getsentry/paths-filter@v2
  32. id: changes
  33. with:
  34. token: ${{ github.token }}
  35. filters: .github/file-filters.yml
  36. # XXX: If taking snapshots with this, be sure to remove above and the following `if` conditions!
  37. - name: Set python version output
  38. id: python-version
  39. if: steps.changes.outputs.backend == 'true'
  40. run: |
  41. echo "::set-output name=python-version::$(grep "3.6" .python-version)"
  42. # Until GH composite actions can use `uses`, we need to setup python here
  43. - uses: actions/setup-python@v2
  44. if: steps.changes.outputs.backend == 'true'
  45. with:
  46. python-version: ${{ steps.python-version.outputs.python-version }}
  47. - name: Setup pip
  48. uses: ./.github/actions/setup-pip
  49. id: pip
  50. if: steps.changes.outputs.backend == 'true'
  51. - name: pip cache
  52. uses: actions/cache@v2
  53. if: steps.changes.outputs.backend == 'true'
  54. with:
  55. path: ${{ steps.pip.outputs.pip-cache-dir }}
  56. key: ${{ runner.os }}-pip-py${{ steps.python-version.outputs.python-version }}-${{ hashFiles('**/requirements-*.txt') }}
  57. restore-keys: |
  58. ${{ runner.os }}-pip-py${{ steps.python-version.outputs.python-version }}
  59. - name: Setup sentry python env
  60. uses: ./.github/actions/setup-sentry
  61. id: setup
  62. if: steps.changes.outputs.backend == 'true'
  63. with:
  64. snuba: true
  65. - name: yarn cache
  66. uses: actions/cache@v2
  67. id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
  68. if: steps.changes.outputs.backend == 'true'
  69. with:
  70. path: ${{ steps.setup.outputs.yarn-cache-dir }}
  71. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  72. restore-keys: |
  73. ${{ runner.os }}-yarn-
  74. - name: Install Javascript Dependencies
  75. if: steps.changes.outputs.backend == 'true'
  76. run: |
  77. yarn install --frozen-lockfile
  78. - name: webpack
  79. if: steps.changes.outputs.backend == 'true'
  80. env:
  81. SENTRY_INSTRUMENTATION: 1
  82. SENTRY_WEBPACK_WEBHOOK_SECRET: ${{ secrets.SENTRY_WEBPACK_WEBHOOK_SECRET }}
  83. run: |
  84. yarn webpack --display errors-only
  85. - name: Run acceptance tests (#${{ steps.setup.outputs.matrix-instance-number }} of ${{ strategy.job-total }})
  86. if: steps.changes.outputs.backend == 'true'
  87. run: |
  88. mkdir -p ${{ steps.setup.outputs.acceptance-dir }}
  89. mkdir -p ${{ steps.setup.outputs.acceptance-dir }}-mobile
  90. mkdir -p ${{ steps.setup.outputs.acceptance-dir }}-tooltips
  91. make run-acceptance
  92. env:
  93. PYTEST_SNAPSHOTS_DIR: ${{ steps.setup.outputs.acceptance-dir }}
  94. USE_SNUBA: 1
  95. - name: Handle artifacts
  96. uses: ./.github/actions/artifacts
  97. # TODO(joshuarli): snapshots, visual-diff needs py3-acceptance.