Start using GitHub Actions and remove Travis

This commit is contained in:
David-Wobrock authored and David Wobrock committed 2020-11-26 18:43:34 +01:00
1 parent 50294a213b
commit 321b41ddd0
6 files changed
+61 -75

No files matched your search

+47
View File
@@ -0,0 +1,47 @@
name: CI Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
python-version: ['2.7', '3.5', '3.6', '3.7', '3.8']
name: Build with Python ${{ matrix.python-version }}
steps:
- name: Checkout code
uses: actions/checkout@v2
# Fetch all tags and branches because tests rely on it
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: python -m pip install tox tox-gh-actions
- name: Test with tox ${{ matrix.python-version }}
run: tox
-71
View File
@@ -1,71 +0,0 @@
language: python
os: linux
dist: xenial
services:
- mysql
- postgresql
git:
depth: false
jobs:
include:
- python: 2.7
env: TOXENV=py27-django111
- python: 3.5
env: TOXENV=py35-django111
- python: 3.5
env: TOXENV=py35-django20
- python: 3.5
env: TOXENV=py35-django21
- python: 3.5
env: TOXENV=py35-django22
- python: 3.6
env: TOXENV=py36-django111
- python: 3.6
env: TOXENV=py36-django20
- python: 3.6
env: TOXENV=py36-django21
- python: 3.6
env: TOXENV=py36-django22
- python: 3.6
env: TOXENV=py36-django30
- python: 3.6
env: TOXENV=py36-django31
- python: 3.7
env: TOXENV=py37-django111
- python: 3.7
env: TOXENV=py37-django20
- python: 3.7
env: TOXENV=py37-django21
- python: 3.7
env: TOXENV=py37-django22
- python: 3.7
env: TOXENV=py37-django30
- python: 3.7
env: TOXENV=py37-django31
- python: 3.8
env: TOXENV=py38-django111
- python: 3.8
env: TOXENV=py38-django20
- python: 3.8
env: TOXENV=py38-django21
- python: 3.8
env: TOXENV=py38-django22
- python: 3.8
env: TOXENV=py38-django30
- python: 3.8
env: TOXENV=py38-django31
- python: 3.6
env: TOXENV=lint
install:
- pip install tox
script:
- tox
+1 -1
View File
@@ -3,7 +3,7 @@
Detect backward incompatible migrations for your Django project.
It will save you time by making sure migrations will not break with a older codebase.
[![Travis](https://travis-ci.org/3YOURMIND/django-migration-linter.svg?branch=master)](https://travis-ci.org/3YOURMIND/django-migration-linter)
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2F3YOURMIND%2Fdjango-migration-linter%2Fbadge%3Fref%3Dmaster&style=flat)](https://actions-badge.atrox.dev/3YOURMIND/django-migration-linter/goto?ref=master)
[![PyPI](https://img.shields.io/pypi/v/django-migration-linter.svg)](https://pypi.python.org/pypi/django-migration-linter/)
[![PR_Welcome](https://img.shields.io/badge/PR-welcome-green.svg)](https://github.com/3YOURMIND/django-migration-linter/pulls)
[![3YD_Hiring](https://img.shields.io/badge/3YOURMIND-Hiring-brightgreen.svg)](https://www.3yourmind.com/career)
+2 -2
View File
@@ -6,9 +6,9 @@ You will need to install the test requirements, which can be found in the ``setu
A good way to get started is to install the development version of the linter by doing ``pip install -e .[test]``.
To be able to fully test the linter, you will need both MySQL and PostgreSQL databases running.
You can either tweak the ``tests/test_project/settings.py`` file to get your DB settings right, or to have databases and users corresponding to the default Travis users.
You can either tweak the ``tests/test_project/settings.py`` file to get your DB settings right, or to have databases and users corresponding to the default CI users.
## Database setup
By default, the test Django project in the repository has multiple databases configured in order to make the Travis tests work.
By default, the test Django project in the repository has multiple databases configured in order to make the CI tests work.
Do not hesitate to modify [the configured test databases](../../tests/test_project/settings.py).
+3 -1
View File
@@ -104,12 +104,14 @@ DATABASES = {
"ENGINE": "django.db.backends.postgresql",
"NAME": "django_migration_linter_test_project",
"USER": "postgres",
"PASSWORD": "postgres",
"HOST": "127.0.0.1",
"TEST": {"DEPENDENCIES": []},
},
"mysql": {
"ENGINE": "django.db.backends.mysql",
"NAME": "django_migration_linter_test_project",
"USER": "travis",
"USER": "root",
"PASSWORD": "",
"HOST": "127.0.0.1",
"TEST": {"DEPENDENCIES": []},
+8
View File
@@ -5,6 +5,14 @@ envlist =
py{36,37,38}-django{30,31}
lint
[gh-actions]
python =
2.7: py27
3.5: py35
3.6: py36, lint
3.7: py37
3.8: py38
[testenv]
commands = ./manage.py test --no-input {posargs}
extras = test