From b70a28dab7d8228cd6ae7930db31ac1c2a65968c Mon Sep 17 00:00:00 2001 From: Marlon Rodriguez Date: Sat, 19 Mar 2022 19:12:19 -0400 Subject: [PATCH] feat: ci: replace travis by github workflows --- .github/workflows/ci.yml | 45 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 20 ------------------ requirements-test.txt | 1 + tox.ini | 19 ++++++++++------- 4 files changed, 58 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9bc095e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: CI + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.6, 3.7, 3.8, 3.9, '3.10'] + + 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 coveralls + pip install -r requirements-test.txt + - name: Test with tox + run: | + tox + - name: Upload coverage data to coveralls.io + run: coveralls --service=github + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_FLAG_NAME: ${{ matrix.python-version }} + COVERALLS_PARALLEL: true + + coveralls: + name: Indicate completion to coveralls.io + needs: build + runs-on: ubuntu-latest + container: python:3-slim + steps: + - name: Finished + run: | + pip3 install --upgrade coveralls + coveralls --service=github --finish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index aa600d0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -sudo: false -language: python -python: - - "2.7" - - "3.4" - - "3.5" - - "3.6" -matrix: - include: - - { python: 3.6, env: TOXENV=flake8 } - - { python: 3.6, env: TOXENV=isort } - # Py37 requires xenial distrubution and sudo - # See travis-ci/travis-ci#9069 - - { python: 3.7, dist: xenial, sudo: true } - -install: - - pip install tox-travis - - pip install coveralls -script: tox -after_success: if [ -e .coverage ]; then coveralls; fi diff --git a/requirements-test.txt b/requirements-test.txt index 7165ac7..3d9b3a2 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,3 +1,4 @@ +tox flake8 flake8-copyright isort diff --git a/tox.ini b/tox.ini index 11c8f61..11cf12a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,17 @@ [tox] -envlist = flake8,isort,py27,py34,py35,py36,py37 +envlist = py36,py37,py38,py39,py310,flake8,isort + +[gh-actions] +python = + 3.6: py36 + 3.7: py37 + 3.8: py38 + 3.9: py39 + 3.10: isort, flake8, py310 + [testenv] -passenv = TRAVIS TRAVIS_* +passenv = GITHUB_* deps = coverage delegator.py @@ -25,8 +34,4 @@ deps = isort delegator.py commands = - isort --check-only --recursive --diff num2words tests - -[testenv:py27] -setenv = - PYTHONIOENCODING = UTF-8 + isort --check-only --float-to-top --diff num2words tests