diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..042382e --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,56 @@ +name: main +on: [push, pull_request] + +jobs: + linters: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + testenv: + - flake8 + - pylint + - pyroma + - check-manifest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: '3.x' + - run: pip install tox + - run: tox -e ${{ matrix.testenv }} + + tests: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [3.5, 3.6, 3.7, 3.8, pypy3, 3.9-dev] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - run: pip install tox + - run: tox -e py + + deploy: + runs-on: ubuntu-latest + needs: [linters, tests] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v1 + with: + python-version: '3.x' + - name: Build package + run: | + python -m pip install --upgrade pip setuptools + pip install wheel + python setup.py sdist bdist_wheel + - name: Publish package to PyPI + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_token }} + diff --git a/.gitignore b/.gitignore index 2a2230b..dc7d3fe 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ __pycache__/ *.pyc /pytest_mccabe.egg-info/ /venv/ +/.venv/ +/build/ +/dist/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 064293e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -sudo: no - -language: python - -python: - - "2.7" - - "3.5" - - "3.6" - - "3.7" - -env: - - PYTEST_VERSION=4.6.3 - - PYTEST_VERSION=5.1.2 - -matrix: - exclude: - env: PYTEST_VERSION=5.1.2 - python: "2.7" - -install: - - pip install . - - pip uninstall -y pytest - - pip install pytest==$PYTEST_VERSION tox - -script: - - py.test test_mccabe.py - - tox -e flake8 - - tox -e pyroma - - tox -e check-manifest