From 44ee98dc2ffe4e5e29e587be7772a5cd4204b4ef Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Wed, 25 Oct 2023 16:53:37 +0200 Subject: [PATCH] ci: move from travis to github workflows --- .github/workflows/linting.yml | 20 +++++++++++++ .github/workflows/tests.yml | 53 +++++++++++++++++++++++++++++++++++ .travis.yml | 14 --------- tox.ini | 24 ++++++---------- 4 files changed, 81 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/linting.yml create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml new file mode 100644 index 0000000..ee0384d --- /dev/null +++ b/.github/workflows/linting.yml @@ -0,0 +1,20 @@ +name: linting + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Install Dependencies + run: | + python -m pip install pep8 + - name: Run pep8 + run: | + pep8 fixture_magic --max-line-length=120 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..92f1496 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,53 @@ +name: Python tests + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-22.04 + strategy: + matrix: + include: + - python-version: "3.7" + django-version: "3.2" + - python-version: "3.9" + django-version: "3.2" + - python-version: "3.9" + django-version: "3.2" + - python-version: "3.10" + django-version: "3.2" + - python-version: "3.9" + django-version: "4.0" + - python-version: "3.10" + django-version: "4.0" + - python-version: "3.9" + django-version: "4.1" + - python-version: "3.10" + django-version: "4.1" + - python-version: "3.11" + django-version: "4.1" + - python-version: "3.9" + django-version: "4.2" + - python-version: "3.10" + django-version: "4.2" + - python-version: "3.11" + django-version: "4.2" + + steps: + - uses: actions/checkout@v4 + - 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 --upgrade pip tox + - name: Run Tests + env: + TOXENV: py${{ matrix.python-version }}-django${{ matrix.django-version }} + run: tox diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a9acb12..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: python -python: - - "3.6" - - "3.7" - - "3.8" - - "3.9" - - "3.10" -install: - - pip install tox - - pip install tox-travis - - pip install pep8 -script: - - tox - - pep8 fixture_magic --max-line-length=120 \ No newline at end of file diff --git a/tox.ini b/tox.ini index 1b4b54b..57b8e6c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,17 +1,9 @@ [tox] -envlist = py{37,38,39,310}-django{32} - py{39,310}-django{40} - py{39,310,311}-django{41} - py{39,310,311}-django{42} +envlist = py{3.7,3.8,3.9,3.10}-django{3.2} + py{3.9,3.10}-django{4.0} + py{3.9,3.10,3.11}-django{4.1} + py{3.9,3.10,3.11}-django{4.2} -[travis] -python = - 3.7: py37 - 3.8: py38 - 3.9: py39 - 3.10: py310 - 3.11: py311 - 3.12: py312 [testenv] setenv = @@ -27,7 +19,7 @@ allowlist_externals = deps = coverage - django32: Django>=3.2,<4.0 - django40: Django>=4.0,<4.1 - django41: Django>=4.1,<4.2 - django42: Django>=4.2,<5.0 + django3.2: Django>=3.2,<4.0 + django4.0: Django>=4.0,<4.1 + django4.1: Django>=4.1,<4.2 + django4.2: Django>=4.2,<5.0