Repository: vanadium23/django-db-comments (language: python)

Issue:
Migrate to Github Action
### Description

I've missed that, travi-ci.org will now have some free plans and has changed site. CI will be dropped in 7 week, so we need to move repo to Github Action.


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
new file mode 100644
index 0000000..79b06aa
--- /dev/null
+++ b/.github/workflows/lint.yml
@@ -0,0 +1,14 @@
+name: lint
+
+on:
+  pull_request:
+  push:
+    branches: [master]
+
+jobs:
+  pre-commit:
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v2
+    - uses: actions/setup-python@v2
+    - uses: pre-commit/action@v2.0.3
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 7427980..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,59 +0,0 @@
-# Config file for automatic testing at travis-ci.org
-
-language: python
-# update for python 3.10
-dist: bionic
-
-python:
-  - "3.10"
-  - "3.9"
-  - "3.8"
-  - "3.7"
-  - "3.6"
-  - "3.5"
-  - "2.7"
-
-env:
-  - DJANGO=111
-  - DJANGO=20
-  - DJANGO=22
-  - DJANGO=31
-  - DJANGO=32
-  - DJANGO=40
-
-matrix:
-  fast_finish: true
-  exclude:
-    - python: "2.7"
-      env: DJANGO=20
-    - python: "2.7"
-      env: DJANGO=22
-    - python: "2.7"
-      env: DJANGO=31
-    - python: "2.7"
-      env: DJANGO=32
-    - python: "2.7"
-      env: DJANGO=40
-    - python: "3.5"
-      env: DJANGO=31
-    - python: "3.5"
-      env: DJANGO=32
-    - python: "3.5"
-      env: DJANGO=40
-    - python: "3.6"
-      env: DJANGO=40
-    - python: "3.7"
-      env: DJANGO=40
-    - python: "3.10"
-      env: DJANGO=111
-    - python: "3.10"
-      env: DJANGO=20
-
-# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
-install: pip install -r requirements_test.txt
-
-# command to run tests using coverage, e.g. python setup.py test
-script: tox -e py$(echo $TRAVIS_PYTHON_VERSION | sed -e 's/\.//g')-django-$DJANGO
-
-after_success:
-  - codecov -e TOX_ENV
diff --git a/tox.ini b/tox.ini
index d9839f4..130ddda 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,28 +1,11 @@
 [tox]
 envlist =
-    {py38,py39,py310}-django-40
-    {py38,py39,py310}-django-32
-    {py37,py38,py39}-django-31
-    {py37,py38,py39}-django-22
-    {py35,py36,py37}-django-20
-    {py27,py35,py36}-django-111
+    py-{3.8,3.9,3.10}-django-{3.2,4.0}
 [testenv]
 setenv =
     PYTHONPATH = {toxinidir}:{toxinidir}/django_db_comments
 commands = coverage run --source django_db_comments runtests.py
 deps =
-    django-111: Django>=1.11,<1.12
-    django-20: Django>=2.0,<2.1
-    django-22: Django>=2.2,<3.0
-    django-31: Django>=3.1,<3.2
-    django-32: Django>=3.2,<4.0
-    django-40: Django>=4.0,<4.1
+    django-3.2: Django>=3.2,<4.0
+    django-4.0: Django>=4.0,<4.1
     -r{toxinidir}/requirements_test.txt
-basepython =
-    py310: python3.10
-    py39: python3.9
-    py38: python3.8
-    py37: python3.7
-    py36: python3.6
-    py35: python3.5
-    py27: python2.7


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
new file mode 100644
index 0000000..ad77cda
--- /dev/null
+++ b/.github/workflows/tests.yml
@@ -0,0 +1,43 @@
+# GitHub actions workflow for testing tmtoolkit
+# Runs tests on Ubuntu, MacOS and Windows with Python versions 3.8, 3.9 and 3.10 each, which means 9 jobs are spawned.
+# Tests are run using tox (https://tox.wiki/).
+#
+# author: Markus Konrad <markus.konrad@wzb.eu>
+
+name: run tests
+
+on:
+  pull_request:
+  push:
+    branches: [master]
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: ["3.8", "3.9", "3.10"]
+        django-version: ["3.2", "4.0"]
+    env:
+      PYTHON: ${{ matrix.python-version }}
+      DJANGO: ${{ matrix.django-version }}
+    steps:
+      - uses: actions/checkout@v2
+      - name: set up python ${{ matrix.python-version }}
+        uses: actions/setup-python@v2
+        with:
+          python-version: ${{ matrix.python-version }}
+          cache: 'pip'
+      - name: install python dependencies
+        run: |
+          python -m pip install --upgrade pip
+          pip install tox
+          pip install -r requirements_test.txt
+      - name: run tox
+        run: tox -e py-${{ matrix.python-version }}-django-${{ matrix.django-version }}
+      - name: Upload coverage to Codecov
+        uses: codecov/codecov-action@v2
+        with:
+          env_vars: PYTHON,DJANGO
+          fail_ci_if_error: true
+          verbose: true