diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml new file mode 100644 index 0000000..fc10904 --- /dev/null +++ b/.github/workflows/ci-build.yml @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a00ef82..0000000 --- a/.travis.yml +++ /dev/null @@ -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 diff --git a/README.md b/README.md index 807694b..5ba2722 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/docs/internals/testing.md b/docs/internals/testing.md index a9e97b8..a1f6d31 100644 --- a/docs/internals/testing.md +++ b/docs/internals/testing.md @@ -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). \ No newline at end of file diff --git a/tests/test_project/settings.py b/tests/test_project/settings.py index 41747b7..2a4cdde 100644 --- a/tests/test_project/settings.py +++ b/tests/test_project/settings.py @@ -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": []}, diff --git a/tox.ini b/tox.ini index 87bcbad..eddb7ed 100644 --- a/tox.ini +++ b/tox.ini @@ -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