Skip to content

Commit

Permalink
Use GitHub Actions instead of Travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Dec 29, 2021
1 parent 366058c commit 193707d
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 57 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Code quality

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run code quality tests with tox
run: tox
env:
TOXENV: black,flake8,mypy,docs,manifest
29 changes: 29 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish

on:
push:
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Build wheel and source tarball
run: |
pip install wheel
python setup.py sdist bdist_wheel
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Tests

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
python: ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy3']

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
pip install tox tox-gh-actions
- name: Run unit tests with tox
run: tox
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ include .coveragerc
include .editorconfig
include .flake8

include codecov.yml
include mypy.ini
include tox.ini

Expand Down
10 changes: 0 additions & 10 deletions codecov.yml

This file was deleted.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ black = [
]
flake8 = "^4.0"
mypy = "0.930"
codecov = "^2"
sphinx = "^2.4"
sphinx_rtd_theme = ">=0.4,<1"
check-manifest = "0.40"
Expand Down
18 changes: 13 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,28 @@
envlist = py3{6,7,8,9,10}, black, flake8, mypy, docs, manifest
isolated_build = true

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310

[testenv:black]
basepython = python3.9
basepython = python3.8
deps = black==21.12b0
commands =
black src tests setup.py -t py39 --check
black src tests setup.py -t py38 --check

[testenv:flake8]
basepython = python3.9
basepython = python3.8
deps = flake8>=4,<5
commands =
flake8 src tests setup.py

[testenv:mypy]
basepython = python3.9
basepython = python3.8
deps = mypy==0.930
commands =
mypy src tests
Expand All @@ -29,7 +37,7 @@ commands =
sphinx-build -b html -nEW docs docs/_build/html

[testenv:manifest]
basepython = python3.9
basepython = python3.8
deps = check-manifest==0.40
commands =
check-manifest -v
Expand Down

0 comments on commit 193707d

Please sign in to comment.