|
@@ -1,197 +0,0 @@
|
|
|
-name: python
|
|
|
-on:
|
|
|
- push:
|
|
|
- branches:
|
|
|
- - master
|
|
|
- - releases/**
|
|
|
- pull_request:
|
|
|
- paths:
|
|
|
- # Matches all python files regardless of directory depth.
|
|
|
- - '**.py'
|
|
|
- - requirements*.txt
|
|
|
-
|
|
|
-jobs:
|
|
|
- check-missing-migration:
|
|
|
- # Not necessary for this job to run on the push branches.
|
|
|
- if: ${{ github.ref != 'refs/heads/master' || contains(github.ref, 'releases/') }}
|
|
|
- name: Check Migration Required
|
|
|
- runs-on: ubuntu-16.04
|
|
|
-
|
|
|
- env:
|
|
|
- PIP_DISABLE_PIP_VERSION_CHECK: on
|
|
|
- SENTRY_LIGHT_BUILD: 1
|
|
|
- SENTRY_SKIP_BACKEND_VALIDATION: 1
|
|
|
- MIGRATIONS_TEST_MIGRATE: 0
|
|
|
-
|
|
|
- # The hostname used to communicate with the PostgreSQL from sentry
|
|
|
- DATABASE_URL: postgresql://postgres:postgres@localhost/sentry
|
|
|
-
|
|
|
- services:
|
|
|
- postgres:
|
|
|
- image: postgres:9.6
|
|
|
- env:
|
|
|
- POSTGRES_USER: postgres
|
|
|
- POSTGRES_PASSWORD: postgres
|
|
|
- ports:
|
|
|
- # Maps tcp port 5432 on service container to the host
|
|
|
- - 5432:5432
|
|
|
- # needed because the postgres container does not provide a healthcheck
|
|
|
- options: >-
|
|
|
- --health-cmd pg_isready
|
|
|
- --health-interval 10s
|
|
|
- --health-timeout 5s
|
|
|
- --health-retries 5
|
|
|
-
|
|
|
- steps:
|
|
|
- - name: Install System Dependencies
|
|
|
- run: |
|
|
|
- sudo apt-get update
|
|
|
- sudo apt-get install -y --no-install-recommends \
|
|
|
- libxmlsec1-dev \
|
|
|
- libmaxminddb-dev
|
|
|
-
|
|
|
- - uses: actions/checkout@v2
|
|
|
-
|
|
|
- - name: Set up outputs
|
|
|
- id: config
|
|
|
- env:
|
|
|
- MATRIX_INSTANCE: ${{ matrix.instance }}
|
|
|
- run: |
|
|
|
- echo "::set-output name=python-version::2.7.17"
|
|
|
-
|
|
|
- - name: Set up Python ${{ steps.config.outputs.python-version }}
|
|
|
- uses: actions/setup-python@v2
|
|
|
- with:
|
|
|
- python-version: ${{ steps.config.outputs.python-version}}
|
|
|
-
|
|
|
- - name: Setup pip
|
|
|
- uses: ./.github/actions/setup-pip
|
|
|
- id: pip
|
|
|
-
|
|
|
- - name: pip cache
|
|
|
- uses: actions/cache@v2
|
|
|
- with:
|
|
|
- path: ${{ steps.pip.outputs.pip-cache-dir }}
|
|
|
- key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-*.txt') }}
|
|
|
- restore-keys: |
|
|
|
- ${{ runner.os }}-pip-
|
|
|
-
|
|
|
- - name: Install Python Dependencies
|
|
|
- env:
|
|
|
- PGPASSWORD: postgres
|
|
|
- run: |
|
|
|
- python setup.py install_egg_info
|
|
|
- pip install wheel # GitHub Actions does not have this installed by default (unlike Travis)
|
|
|
- pip install -U -e ".[dev]"
|
|
|
- psql -c 'create database sentry;' -h localhost -U postgres
|
|
|
- sentry init
|
|
|
-
|
|
|
- - name: Check if a migration is required
|
|
|
- env:
|
|
|
- SENTRY_LOG_LEVEL: ERROR
|
|
|
- PGPASSWORD: postgres
|
|
|
- run: |
|
|
|
- # Below will exit with non-zero status if model changes are missing migrations
|
|
|
- sentry django makemigrations -n ci_test --check --dry-run --no-input || (echo '::error::Error: Migration required -- to generate a migration, run `sentry django makemigrations -n <some_name>`' && exit 1)
|
|
|
-
|
|
|
- test-py3:
|
|
|
- name: 'python3.6 backend'
|
|
|
- runs-on: ubuntu-16.04
|
|
|
- timeout-minutes: 30
|
|
|
- strategy:
|
|
|
- matrix:
|
|
|
- instance: [0, 1, 2]
|
|
|
-
|
|
|
- env:
|
|
|
- MIGRATIONS_TEST_MIGRATE: 1
|
|
|
-
|
|
|
- steps:
|
|
|
- - uses: actions/checkout@v2
|
|
|
-
|
|
|
- - uses: volta-cli/action@v1
|
|
|
-
|
|
|
- - name: Set python version output
|
|
|
- id: python-version
|
|
|
- run: |
|
|
|
- echo "::set-output name=python-version::$(awk 'FNR == 2' .python-version)"
|
|
|
-
|
|
|
- # Until GH composite actions can use `uses`, we need to setup python here
|
|
|
- - uses: actions/setup-python@v2
|
|
|
- with:
|
|
|
- python-version: ${{ steps.python-version.outputs.python-version }}
|
|
|
-
|
|
|
- - name: Setup pip
|
|
|
- uses: ./.github/actions/setup-pip
|
|
|
- id: pip
|
|
|
-
|
|
|
- - name: pip cache
|
|
|
- uses: actions/cache@v2
|
|
|
- with:
|
|
|
- path: ${{ steps.pip.outputs.pip-cache-dir }}
|
|
|
- key: ${{ runner.os }}-pip-py${{ steps.python-version.outputs.python-version }}-${{ hashFiles('**/requirements-*.txt') }}
|
|
|
- restore-keys: |
|
|
|
- ${{ runner.os }}-pip-py${{ steps.python-version.outputs.python-version }}
|
|
|
-
|
|
|
- - name: Setup sentry env
|
|
|
- uses: ./.github/actions/setup-sentry
|
|
|
- id: setup
|
|
|
- with:
|
|
|
- python: 3
|
|
|
-
|
|
|
- - name: Python 3.6 backend (${{ steps.setup.outputs.matrix-instance-number }} of ${{ strategy.job-total }})
|
|
|
- if: always()
|
|
|
- run: |
|
|
|
- make travis-test-postgres
|
|
|
-
|
|
|
- test-py3-snuba:
|
|
|
- name: '[ignore fails] python3.6 backend (snuba)'
|
|
|
- runs-on: ubuntu-16.04
|
|
|
- continue-on-error: true
|
|
|
- timeout-minutes: 30
|
|
|
- strategy:
|
|
|
- matrix:
|
|
|
- instance: [0]
|
|
|
-
|
|
|
- env:
|
|
|
- # Note: `USE_SNUBA` is only used for the Snuba test suite because we have some failing acceptance tests with Snuba enabled.
|
|
|
- USE_SNUBA: 1
|
|
|
- MIGRATIONS_TEST_MIGRATE: 1
|
|
|
-
|
|
|
- steps:
|
|
|
- - uses: actions/checkout@v2
|
|
|
-
|
|
|
- - uses: volta-cli/action@v1
|
|
|
-
|
|
|
- - name: Set python version output
|
|
|
- id: python-version
|
|
|
- run: |
|
|
|
- echo "::set-output name=python-version::$(awk 'FNR == 2' .python-version)"
|
|
|
-
|
|
|
- # Until GH composite actions can use `uses`, we need to setup python here
|
|
|
- - uses: actions/setup-python@v2
|
|
|
- with:
|
|
|
- python-version: ${{ steps.python-version.outputs.python-version }}
|
|
|
-
|
|
|
- - name: Setup pip
|
|
|
- uses: ./.github/actions/setup-pip
|
|
|
- id: pip
|
|
|
-
|
|
|
- - name: pip cache
|
|
|
- uses: actions/cache@v2
|
|
|
- with:
|
|
|
- path: ${{ steps.pip.outputs.pip-cache-dir }}
|
|
|
- key: ${{ runner.os }}-pip-py${{ steps.python-version.outputs.python-version }}-${{ hashFiles('**/requirements-*.txt') }}
|
|
|
- restore-keys: |
|
|
|
- ${{ runner.os }}-pip-py${{ steps.python-version.outputs.python-version }}
|
|
|
-
|
|
|
- - name: Setup sentry env
|
|
|
- uses: ./.github/actions/setup-sentry
|
|
|
- id: setup
|
|
|
- with:
|
|
|
- python: 3
|
|
|
- kafka: true
|
|
|
-
|
|
|
- - name: Python 3.6 snuba backend (${{ steps.setup.outputs.matrix-instance-number }} of ${{ strategy.job-total }})
|
|
|
- if: always()
|
|
|
- run: |
|
|
|
- make travis-test-snuba
|