Skip to content

Commit

Permalink
Replace Travis CI configuration with GitHub Actions (#561)
Browse files Browse the repository at this point in the history
Co-authored-by: Hugo van Kemenade <[email protected]>
  • Loading branch information
akx and hugovk authored Dec 12, 2023
1 parent 1a5f26d commit 0ead3b6
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 70 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release
on:
push:
branches:
- master
tags:
- '*'

jobs:
Build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3"
cache: pip
cache-dependency-path: setup.cfg
# TODO: look into using python-babel instead of requiring gettext as system dependency
- run: sudo apt-get update && sudo apt-get install -y --no-install-recommends gettext
- run: pip install -U build
- run: python -m build
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
60 changes: 60 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Test
on:
- pull_request
- push
- workflow_dispatch
jobs:
Build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3"
cache: pip
cache-dependency-path: setup.cfg
# TODO: look into using python-babel instead of requiring gettext as system dependency
- run: sudo apt-get update && sudo apt-get install -y --no-install-recommends gettext
- run: pip install -U build
- run: python -m build
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
Test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
- os: ubuntu-20.04
python-version: "3.6"
- os: ubuntu-20.04
python-version: "3.7"
- os: ubuntu-22.04
python-version: "3.8"
- os: ubuntu-22.04
python-version: "3.9"
- os: ubuntu-22.04
python-version: "3.10"
steps:
- uses: actions/checkout@v4
- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python-version }}"
cache: pip
cache-dependency-path: setup.cfg
# TODO: look into using python-babel instead of requiring gettext as system dependency
- run: sudo apt-get update && sudo apt-get install -y --no-install-recommends gettext
# TODO: look into using python-babel instead of requiring django to be ambiently installed
# so tox can build messages
- run: pip install -U tox tox-gh-actions django
# TODO: postgres setup and proper djangomain testing
- run: python -m tox
- run: |
mkdir /tmp/coverage
find .tox -type f -name 'coverage*xml' -exec mv '{}' /tmp/coverage ';'
- uses: codecov/codecov-action@v3
with:
directory: /tmp/coverage
62 changes: 0 additions & 62 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. image:: https://travis-ci.org/jazzband/django-polymorphic.svg?branch=master
:target: http://travis-ci.org/jazzband/django-polymorphic
.. image:: https://github.com/jazzband/django-polymorphic/actions/workflows/test.yml/badge.svg
:target: https://github.com/jazzband/django-polymorphic/actions/workflows/test.yml
.. image:: https://img.shields.io/pypi/v/django-polymorphic.svg
:target: https://pypi.python.org/pypi/django-polymorphic/
.. image:: https://img.shields.io/codecov/c/github/jazzband/django-polymorphic/master.svg
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[build-system]
requires = [
"setuptools",
# TODO: look into using python-babel instead of requiring django at build time
"django>=2.1", # for makemessages
]

[tool.isort]
profile = "black"
line_length = 99
Expand Down
19 changes: 13 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ envlist =
py36-django{22,30,31}
py37-django{22,30,31}
py38-django{22,30,31,32}
py39-django{40}
py{39,310}-django{40,41,42}
# TODO: reinstate running on postgres: py39-django{40}-postgres
docs

[testenv]
Expand All @@ -14,11 +15,12 @@ setenv =
deps =
coverage
dj-database-url
django21: Django ~= 2.1
django22: Django ~= 2.2
django30: Django ~= 3.0
django31: Django ~= 3.1
django40: Django==4.0b1
django40: Django ~= 4.0
django41: Django ~= 4.1
django42: Django ~= 4.2
djangomain: https://github.com/django/django/archive/main.tar.gz
postgres: psycopg2
commands =
Expand All @@ -32,6 +34,11 @@ deps =
changedir = docs
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html

[flake8]
# ignore line size
max-line-length = 300
[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311

0 comments on commit 0ead3b6

Please sign in to comment.