Skip to content

build(ci): Remove TravisCI #962

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .craft.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
minVersion: '0.5.1'
minVersion: "0.14.0"
github:
owner: getsentry
repo: sentry-python
targets:

targets:
- name: pypi
- name: github
- name: gh-pages
Expand All @@ -14,3 +15,8 @@ targets:

changelog: CHANGES.md
changelogPolicy: simple

statusProvider:
name: github
artifactProvider:
name: github
140 changes: 140 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
name: ci

on:
push:
branches:
- master
- release/**

pull_request:

jobs:
dist:
name: distribution packages
timeout-minutes: 10
runs-on: ubuntu-16.04

if: "startsWith(github.ref, 'refs/heads/release/')"

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-python@v2
with:
python-version: 3.9

- run: |
pip install virtualenv
make dist

- uses: actions/upload-artifact@v2
with:
name: ${{ github.sha }}
path: dist/*

docs:
timeout-minutes: 10
name: build documentation
runs-on: ubuntu-16.04

if: "startsWith(github.ref, 'refs/heads/release/')"

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-python@v2
with:
python-version: 3.9

- run: |
pip install virtualenv
make apidocs
cd docs/_build && zip -r gh-pages ./

- uses: actions/upload-artifact@v2
with:
name: ${{ github.sha }}
path: docs/_build/gh-pages.zip

lint:
timeout-minutes: 10
runs-on: ubuntu-16.04

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9

- run: |
pip install tox
tox -e linters

test:
continue-on-error: true
timeout-minutes: 35
runs-on: ubuntu-18.04
strategy:
matrix:
python-version:
["2.7", "pypy-2.7", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9"]

services:
# Label used to access the service container
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps port 6379 on service container to the host
- 6379:6379

postgres:
image: postgres
env:
POSTGRES_PASSWORD: sentry
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
# Maps tcp port 5432 on service container to the host
ports:
- 5432:5432

env:
SENTRY_PYTHON_TEST_POSTGRES_USER: postgres
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry
SENTRY_PYTHON_TEST_POSTGRES_NAME: ci_test

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: setup
env:
PGHOST: localhost
PGPASSWORD: sentry
run: |
psql -c 'create database travis_ci_test;' -U postgres
psql -c 'create database test_travis_ci_test;' -U postgres
pip install codecov tox

- name: run tests
env:
CI_PYTHON_VERSION: ${{ matrix.python-version }}
run: |
coverage erase
./scripts/runtox.sh '' --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
coverage combine .coverage*
coverage xml -i
codecov --file coverage.xml
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: Version to release
required: true
force:
description: Force a release even when there are release-blockers (optional)
required: false

jobs:
release:
runs-on: ubuntu-latest
name: "Release a new version"
steps:
- name: Prepare release
uses: getsentry/action-prepare-release@33507ed
with:
version: ${{ github.event.inputs.version }}
force: ${{ github.event.inputs.force }}

- uses: actions/checkout@v2
with:
token: ${{ secrets.GH_RELEASE_PAT }}
fetch-depth: 0

- name: Craft Prepare
run: npx @sentry/craft prepare --no-input "${{ env.RELEASE_VERSION }}"
env:
GITHUB_API_TOKEN: ${{ github.token }}

- name: Request publish
if: success()
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GH_RELEASE_PAT }}
script: |
const repoInfo = context.repo;
await github.issues.create({
owner: repoInfo.owner,
repo: 'publish',
title: `publish: ${repoInfo.repo}@${process.env.RELEASE_VERSION}`,
});
81 changes: 0 additions & 81 deletions .travis.yml

This file was deleted.

15 changes: 0 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,3 @@ apidocs-hotfix: apidocs
@$(VENV_PATH)/bin/pip install ghp-import
@$(VENV_PATH)/bin/ghp-import -pf docs/_build
.PHONY: apidocs-hotfix

install-zeus-cli:
npm install -g @zeus-ci/cli
.PHONY: install-zeus-cli

travis-upload-docs: apidocs install-zeus-cli
cd docs/_build && zip -r gh-pages ./
zeus upload -t "application/zip+docs" docs/_build/gh-pages.zip \
|| [[ ! "$(TRAVIS_BRANCH)" =~ ^release/ ]]
.PHONY: travis-upload-docs

travis-upload-dist: dist install-zeus-cli
zeus upload -t "application/zip+wheel" dist/* \
|| [[ ! "$(TRAVIS_BRANCH)" =~ ^release/ ]]
.PHONY: travis-upload-dist
5 changes: 5 additions & 0 deletions scripts/bump-version.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash
set -eux

if [ "$(uname -s)" != "Linux" ]; then
echo "Please use the GitHub Action."
exit 1
fi

SCRIPT_DIR="$( dirname "$0" )"
cd $SCRIPT_DIR/..

Expand Down
7 changes: 5 additions & 2 deletions scripts/runtox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ fi

if [ -n "$1" ]; then
searchstring="$1"
elif [ -n "$TRAVIS_PYTHON_VERSION" ]; then
searchstring="$(echo py$TRAVIS_PYTHON_VERSION | sed -e 's/pypypy/pypy/g' -e 's/-dev//g')"
elif [ -n "$CI_PYTHON_VERSION" ]; then
searchstring="$(echo py$CI_PYTHON_VERSION | sed -e 's/pypypy/pypy/g' -e 's/-dev//g')"
if [ "$searchstring" = "pypy-2.7" ]; then
searchstring=pypy
fi
elif [ -n "$AZURE_PYTHON_VERSION" ]; then
searchstring="$(echo py$AZURE_PYTHON_VERSION | sed -e 's/pypypy/pypy/g' -e 's/-dev//g')"
if [ "$searchstring" = pypy2 ]; then
Expand Down
1 change: 1 addition & 0 deletions tests/integrations/django/myapp/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def middleware(request):
"ENGINE": "django.db.backends.postgresql_psycopg2",
"NAME": os.environ["SENTRY_PYTHON_TEST_POSTGRES_NAME"],
"USER": os.environ["SENTRY_PYTHON_TEST_POSTGRES_USER"],
"PASSWORD": os.environ["SENTRY_PYTHON_TEST_POSTGRES_PASSWORD"],
"HOST": "localhost",
"PORT": 5432,
}
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ passenv =
SENTRY_PYTHON_TEST_AWS_SECRET_ACCESS_KEY
SENTRY_PYTHON_TEST_AWS_IAM_ROLE
SENTRY_PYTHON_TEST_POSTGRES_USER
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD
SENTRY_PYTHON_TEST_POSTGRES_NAME
usedevelop = True
extras =
Expand Down