123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- name: backend
- on:
- push:
- branches:
- - master
- - releases/**
- pull_request:
- jobs:
- test:
- name: backend test
- runs-on: ubuntu-16.04
- timeout-minutes: 20
- strategy:
- matrix:
- instance: [0, 1, 2]
- env:
- MIGRATIONS_TEST_MIGRATE: 1
- steps:
- - uses: actions/checkout@v2
- # If we make these jobs "required" to merge on GH, then on every PR, GitHub automatically
- # creates a status check in the "pending" state. This means that the workflow needs to run
- # for every PR in order to update the status checks.
- #
- # In order to optimize CI usage, we want the tests to only run when python files change,
- # since frontend changes should have no effect on these test suites. We cannot use GH workflow
- # path filters because entire workflow would be skipped vs skipping individual jobs which
- # would still allow this status check to pass.
- - name: Check for python file changes
- uses: getsentry/paths-filter@v2
- id: changes
- with:
- token: ${{ github.token }}
- filters: .github/file-filters.yml
- # Until GH composite actions can use `uses`, we need to setup python here
- - uses: actions/setup-python@v2
- if: steps.changes.outputs.backend == 'true'
- with:
- python-version: 2.7.17
- - name: Setup pip
- uses: ./.github/actions/setup-pip
- id: pip
- if: steps.changes.outputs.backend == 'true'
- - name: pip cache
- uses: actions/cache@v2
- if: steps.changes.outputs.backend == 'true'
- with:
- path: ${{ steps.pip.outputs.pip-cache-dir }}
- key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-*.txt') }}
- restore-keys: |
- ${{ runner.os }}-pip-
- - name: Setup sentry env
- uses: ./.github/actions/setup-sentry
- id: setup
- if: steps.changes.outputs.backend == 'true'
- with:
- python: 2
- snuba: true
- - name: Run backend test [py2.7] (${{ steps.setup.outputs.matrix-instance-number }} of ${{ strategy.job-total }})
- if: steps.changes.outputs.backend == 'true'
- run: |
- # Note: `USE_SNUBA` is not used for backend tests because there are a few failing tests with Snuba enabled.
- unset USE_SNUBA
- make travis-test-postgres
|