Skip to content

Commit 64e781d

Browse files
billyvgjan-auer
andauthored
build(ci): Remove TravisCI (getsentry#962)
Remove Travis in favor of GHA. Remove zeus as well. Co-authored-by: Jan Michael Auer <mail@jauer.org>
1 parent 38b983e commit 64e781d

File tree

9 files changed

+205
-100
lines changed

9 files changed

+205
-100
lines changed

.craft.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
2-
minVersion: '0.5.1'
2+
minVersion: "0.14.0"
33
github:
44
owner: getsentry
55
repo: sentry-python
6-
targets:
6+
7+
targets:
78
- name: pypi
89
- name: github
910
- name: gh-pages
@@ -14,3 +15,8 @@ targets:
1415

1516
changelog: CHANGES.md
1617
changelogPolicy: simple
18+
19+
statusProvider:
20+
name: github
21+
artifactProvider:
22+
name: github

.github/workflows/ci.yml

+140
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
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

.github/workflows/release.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: Version to release
8+
required: true
9+
force:
10+
description: Force a release even when there are release-blockers (optional)
11+
required: false
12+
13+
jobs:
14+
release:
15+
runs-on: ubuntu-latest
16+
name: "Release a new version"
17+
steps:
18+
- name: Prepare release
19+
uses: getsentry/action-prepare-release@33507ed
20+
with:
21+
version: ${{ github.event.inputs.version }}
22+
force: ${{ github.event.inputs.force }}
23+
24+
- uses: actions/checkout@v2
25+
with:
26+
token: ${{ secrets.GH_RELEASE_PAT }}
27+
fetch-depth: 0
28+
29+
- name: Craft Prepare
30+
run: npx @sentry/craft prepare --no-input "${{ env.RELEASE_VERSION }}"
31+
env:
32+
GITHUB_API_TOKEN: ${{ github.token }}
33+
34+
- name: Request publish
35+
if: success()
36+
uses: actions/github-script@v3
37+
with:
38+
github-token: ${{ secrets.GH_RELEASE_PAT }}
39+
script: |
40+
const repoInfo = context.repo;
41+
await github.issues.create({
42+
owner: repoInfo.owner,
43+
repo: 'publish',
44+
title: `publish: ${repoInfo.repo}@${process.env.RELEASE_VERSION}`,
45+
});

.travis.yml

-81
This file was deleted.

Makefile

-15
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,3 @@ apidocs-hotfix: apidocs
5858
@$(VENV_PATH)/bin/pip install ghp-import
5959
@$(VENV_PATH)/bin/ghp-import -pf docs/_build
6060
.PHONY: apidocs-hotfix
61-
62-
install-zeus-cli:
63-
npm install -g @zeus-ci/cli
64-
.PHONY: install-zeus-cli
65-
66-
travis-upload-docs: apidocs install-zeus-cli
67-
cd docs/_build && zip -r gh-pages ./
68-
zeus upload -t "application/zip+docs" docs/_build/gh-pages.zip \
69-
|| [[ ! "$(TRAVIS_BRANCH)" =~ ^release/ ]]
70-
.PHONY: travis-upload-docs
71-
72-
travis-upload-dist: dist install-zeus-cli
73-
zeus upload -t "application/zip+wheel" dist/* \
74-
|| [[ ! "$(TRAVIS_BRANCH)" =~ ^release/ ]]
75-
.PHONY: travis-upload-dist

scripts/bump-version.sh

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/bin/bash
22
set -eux
33

4+
if [ "$(uname -s)" != "Linux" ]; then
5+
echo "Please use the GitHub Action."
6+
exit 1
7+
fi
8+
49
SCRIPT_DIR="$( dirname "$0" )"
510
cd $SCRIPT_DIR/..
611

scripts/runtox.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ fi
1414

1515
if [ -n "$1" ]; then
1616
searchstring="$1"
17-
elif [ -n "$TRAVIS_PYTHON_VERSION" ]; then
18-
searchstring="$(echo py$TRAVIS_PYTHON_VERSION | sed -e 's/pypypy/pypy/g' -e 's/-dev//g')"
17+
elif [ -n "$CI_PYTHON_VERSION" ]; then
18+
searchstring="$(echo py$CI_PYTHON_VERSION | sed -e 's/pypypy/pypy/g' -e 's/-dev//g')"
19+
if [ "$searchstring" = "pypy-2.7" ]; then
20+
searchstring=pypy
21+
fi
1922
elif [ -n "$AZURE_PYTHON_VERSION" ]; then
2023
searchstring="$(echo py$AZURE_PYTHON_VERSION | sed -e 's/pypypy/pypy/g' -e 's/-dev//g')"
2124
if [ "$searchstring" = pypy2 ]; then

tests/integrations/django/myapp/settings.py

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ def middleware(request):
125125
"ENGINE": "django.db.backends.postgresql_psycopg2",
126126
"NAME": os.environ["SENTRY_PYTHON_TEST_POSTGRES_NAME"],
127127
"USER": os.environ["SENTRY_PYTHON_TEST_POSTGRES_USER"],
128+
"PASSWORD": os.environ["SENTRY_PYTHON_TEST_POSTGRES_PASSWORD"],
128129
"HOST": "localhost",
129130
"PORT": 5432,
130131
}

tox.ini

+1
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ passenv =
263263
SENTRY_PYTHON_TEST_AWS_SECRET_ACCESS_KEY
264264
SENTRY_PYTHON_TEST_AWS_IAM_ROLE
265265
SENTRY_PYTHON_TEST_POSTGRES_USER
266+
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD
266267
SENTRY_PYTHON_TEST_POSTGRES_NAME
267268
usedevelop = True
268269
extras =

0 commit comments

Comments
 (0)