Skip to content

Commit

Permalink
Switch from Travis CI to GitHub Actions and use tox
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-k authored and markpeek committed Mar 21, 2021
1 parent e91322c commit 51374d8
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 24 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: Tests

on:
push:
branches:
- master
- main
pull_request:

jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- 3.6
- 3.7
- 3.8
- 3.9

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 tox tox-factor
- name: Run tox targets for ${{ matrix.python-version }}
run: |
PYVERSION=$(python -c "import sys; print(''.join([str(sys.version_info.major), str(sys.version_info.minor)]))")
python -m tox -f $(python -m tox --listenvs | grep "^py${PYVERSION}" | tr '\n' ',')
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip tox
- name: Lint code
run: python -m tox -e qa
- name: Check readme
run: python -m tox -e readme
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.PHONY: test

PYDIRS=setup.py awacs examples tests
PYVERSION=`python -c "import sys; print(''.join([str(sys.version_info.major), str(sys.version_info.minor)]))"`

test:
pycodestyle ${PYDIRS}
pyflakes ${PYDIRS}
python setup.py test
python -m tox -e qa
python -m tox --listenvs | grep "^py${PYVERSION}" | tr "\n" "," | xargs python -m tox -f
23 changes: 23 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[tox]
envlist =
py{36,37,38,39}
qa,readme

[testenv]
commands = python -W error::DeprecationWarning -W error::PendingDeprecationWarning setup.py test {posargs}

[testenv:qa]
deps =
pycodestyle
pyflakes
commands =
pycodestyle --version
pycodestyle --show-source --show-pep8 .
pyflakes ./awacs

[testenv:readme]
deps =
twine
commands =
python setup.py sdist bdist_wheel
twine check dist/*

0 comments on commit 51374d8

Please sign in to comment.