Skip to content

Commit

Permalink
Migrate from TravisCI to Github Actions
Browse files Browse the repository at this point in the history
* Move requirements into separate files for future dependabot support
* Add config for coverage via pyproject.toml
* Add a codecov config
* For now, remove package publishing config until it can be migrated to
  Github Actions
  • Loading branch information
ThePumpingLemma authored and David Grochowski committed Nov 11, 2020
1 parent 4cb4d2d commit 342daf5
Show file tree
Hide file tree
Showing 13 changed files with 79 additions and 61 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: build

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]

jobs:
build:
name: python ${{ matrix.python-version }}
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- 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 setuptools wheel
pip install -r requirements/tox.txt
- name: run tox
run: tox
- name: publish coverage
uses: codecov/codecov-action@v1
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

Empty file modified AUTHORS.rst
100755 → 100644
Empty file.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changes
Unreleased
----------
- Removed support for Django versions prior to 2.2 (gh-652)
- Migrate from TravisCI to Github Actions (gh-739)

2.12.0 (2020-10-14)
-------------------
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
django-simple-history
=====================

.. image:: https://secure.travis-ci.org/jazzband/django-simple-history.svg?branch=master
:target: http://travis-ci.org/jazzband/django-simple-history
.. image:: https://github.com/jazzband/django-simple-history/workflows/build/badge.svg?branch=master
:target: https://github.com/jazzband/django-simple-history/actions?workflow=build
:alt: Build Status

.. image:: https://readthedocs.org/projects/django-simple-history/badge/?version=latest
Expand Down
2 changes: 2 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignore:
- "requirements/*.txt"
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[tool.coverage.run]
parallel = true
branch = true
source = ["simple_history"]

[tool.coverage.paths]
source = ["simple_history", ".tox/*/site-packages"]

[tool.coverage.report]
show_missing = true
skip_covered = true
omit = ["requirements/*"]
2 changes: 2 additions & 0 deletions requirements/coverage.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage==5.3
toml==0.10.2
1 change: 1 addition & 0 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Sphinx==3.3.0
2 changes: 2 additions & 0 deletions requirements/lint.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
black==20.8.b1
flake8==3.8.4
1 change: 1 addition & 0 deletions requirements/test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-r ./coverage.txt
3 changes: 3 additions & 0 deletions requirements/tox.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-r ./coverage.txt
tox==3.20.1
tox-gh-actions==2.1.0
49 changes: 22 additions & 27 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,40 @@ envlist =
py{36,37,38}-django30,
py{36,37,38}-django31,
py{36,37,38}-djangodev,
py38-flake8,
docs
py{36,38}-black
docs,
lint

[travis]
[gh-actions]
python =
3.5: py35
3.6: py36, docs
3.7: py37
3.8: py38
3.5: py35
3.6: py36
3.7: py37
3.8: py38, docs, lint

[flake8]
ignore = N802,F401,W503
max-complexity = 10
max-line-length = 88
exclude = __init__.py,simple_history/registry_tests/migration_test_app/migrations/*

[testenv]
deps =
coverage
codecov
-rrequirements/test.txt
django22: Django>=2.2,<2.3
django30: Django>=3.0,<3.1
django31: Django>=3.1,<3.2
djangodev: https://github.com/django/django/tarball/master
commands =
coverage run -a --branch runtests.py

[flake8]
ignore = N802,F401,W503
max-complexity = 10
max-line-length = 88
exclude = __init__.py,simple_history/registry_tests/migration_test_app/migrations/*
coverage run -a runtests.py
coverage report

[testenv:py38-flake8]
deps = flake8
commands = flake8 simple_history

[testenv:py{36,38}-black]
deps =
black==20.8.b1
commands = black --check simple_history setup.py runtests.py
[testenv:lint]
deps = -rrequirements/lint.txt
commands =
black --check simple_history setup.py runtests.py
flake8 simple_history

[testenv:docs]
changedir = docs
deps =
Sphinx
deps = -rrequirements/docs.txt
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html

0 comments on commit 342daf5

Please sign in to comment.