|
| 1 | +name: ci |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + - release/** |
| 8 | + |
| 9 | + pull_request: |
| 10 | + |
| 11 | +jobs: |
| 12 | + dist: |
| 13 | + name: distribution packages |
| 14 | + timeout-minutes: 10 |
| 15 | + runs-on: ubuntu-16.04 |
| 16 | + |
| 17 | + if: "startsWith(github.ref, 'refs/heads/release/')" |
| 18 | + |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v2 |
| 21 | + - uses: actions/setup-node@v1 |
| 22 | + - uses: actions/setup-python@v2 |
| 23 | + with: |
| 24 | + python-version: 3.9 |
| 25 | + |
| 26 | + - run: | |
| 27 | + pip install virtualenv |
| 28 | + make dist |
| 29 | +
|
| 30 | + - uses: actions/upload-artifact@v2 |
| 31 | + with: |
| 32 | + name: ${{ github.sha }} |
| 33 | + path: dist/* |
| 34 | + |
| 35 | + docs: |
| 36 | + timeout-minutes: 10 |
| 37 | + name: build documentation |
| 38 | + runs-on: ubuntu-16.04 |
| 39 | + |
| 40 | + if: "startsWith(github.ref, 'refs/heads/release/')" |
| 41 | + |
| 42 | + steps: |
| 43 | + - uses: actions/checkout@v2 |
| 44 | + - uses: actions/setup-node@v1 |
| 45 | + - uses: actions/setup-python@v2 |
| 46 | + with: |
| 47 | + python-version: 3.9 |
| 48 | + |
| 49 | + - run: | |
| 50 | + pip install virtualenv |
| 51 | + make apidocs |
| 52 | + cd docs/_build && zip -r gh-pages ./ |
| 53 | +
|
| 54 | + - uses: actions/upload-artifact@v2 |
| 55 | + with: |
| 56 | + name: ${{ github.sha }} |
| 57 | + path: docs/_build/gh-pages.zip |
| 58 | + |
| 59 | + lint: |
| 60 | + timeout-minutes: 10 |
| 61 | + runs-on: ubuntu-16.04 |
| 62 | + |
| 63 | + steps: |
| 64 | + - uses: actions/checkout@v2 |
| 65 | + - uses: actions/setup-python@v2 |
| 66 | + with: |
| 67 | + python-version: 3.9 |
| 68 | + |
| 69 | + - run: | |
| 70 | + pip install tox |
| 71 | + tox -e linters |
| 72 | +
|
| 73 | + test: |
| 74 | + continue-on-error: true |
| 75 | + timeout-minutes: 35 |
| 76 | + runs-on: ubuntu-18.04 |
| 77 | + strategy: |
| 78 | + matrix: |
| 79 | + python-version: |
| 80 | + ["2.7", "pypy-2.7", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9"] |
| 81 | + |
| 82 | + services: |
| 83 | + # Label used to access the service container |
| 84 | + redis: |
| 85 | + # Docker Hub image |
| 86 | + image: redis |
| 87 | + # Set health checks to wait until redis has started |
| 88 | + options: >- |
| 89 | + --health-cmd "redis-cli ping" |
| 90 | + --health-interval 10s |
| 91 | + --health-timeout 5s |
| 92 | + --health-retries 5 |
| 93 | + ports: |
| 94 | + # Maps port 6379 on service container to the host |
| 95 | + - 6379:6379 |
| 96 | + |
| 97 | + postgres: |
| 98 | + image: postgres |
| 99 | + env: |
| 100 | + POSTGRES_PASSWORD: sentry |
| 101 | + # Set health checks to wait until postgres has started |
| 102 | + options: >- |
| 103 | + --health-cmd pg_isready |
| 104 | + --health-interval 10s |
| 105 | + --health-timeout 5s |
| 106 | + --health-retries 5 |
| 107 | + # Maps tcp port 5432 on service container to the host |
| 108 | + ports: |
| 109 | + - 5432:5432 |
| 110 | + |
| 111 | + env: |
| 112 | + SENTRY_PYTHON_TEST_POSTGRES_USER: postgres |
| 113 | + SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry |
| 114 | + SENTRY_PYTHON_TEST_POSTGRES_NAME: ci_test |
| 115 | + |
| 116 | + steps: |
| 117 | + - uses: actions/checkout@v2 |
| 118 | + - uses: actions/setup-node@v1 |
| 119 | + - uses: actions/setup-python@v2 |
| 120 | + with: |
| 121 | + python-version: ${{ matrix.python-version }} |
| 122 | + |
| 123 | + - name: setup |
| 124 | + env: |
| 125 | + PGHOST: localhost |
| 126 | + PGPASSWORD: sentry |
| 127 | + run: | |
| 128 | + psql -c 'create database travis_ci_test;' -U postgres |
| 129 | + psql -c 'create database test_travis_ci_test;' -U postgres |
| 130 | + pip install codecov tox |
| 131 | +
|
| 132 | + - name: run tests |
| 133 | + env: |
| 134 | + CI_PYTHON_VERSION: ${{ matrix.python-version }} |
| 135 | + run: | |
| 136 | + coverage erase |
| 137 | + ./scripts/runtox.sh '' --cov=tests --cov=sentry_sdk --cov-report= --cov-branch |
| 138 | + coverage combine .coverage* |
| 139 | + coverage xml -i |
| 140 | + codecov --file coverage.xml |
0 commit comments