From 5666d66bfbf707678a34b2fb735e7023f0d9c6a5 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 7 Jul 2021 00:05:21 +0200 Subject: [PATCH] Use GitHub Actions instead of Travis CI --- .github/workflows/lint-python.yml | 21 +++++++++++++++++++++ .github/workflows/tox.yml | 24 ++++++++++++++++++++++++ .travis.yml | 21 --------------------- 3 files changed, 45 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/lint-python.yml create mode 100644 .github/workflows/tox.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/lint-python.yml b/.github/workflows/lint-python.yml new file mode 100644 index 00000000..081a537c --- /dev/null +++ b/.github/workflows/lint-python.yml @@ -0,0 +1,21 @@ +name: lint_python +on: [pull_request, push] +jobs: + lint_python: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - run: pip install bandit black codespell flake8 isort mypy pytest pyupgrade safety + - run: bandit --recursive --skip B101,B105,B106,B110,B303,B404,B603 . + - run: black --check . || true + - run: codespell || true # --ignore-words-list="" --skip="" + - run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + - run: flake8 . --count --exit-zero --max-complexity=29 --max-line-length=167 --show-source --statistics + - run: isort --check-only --profile black . || true + - run: pip install -e . + - run: mypy --ignore-missing-imports . || true + - run: mv setup.cfg setup.cfg.disabled + - run: pytest . + - run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true + - run: safety check diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml new file mode 100644 index 00000000..37186bf5 --- /dev/null +++ b/.github/workflows/tox.yml @@ -0,0 +1,24 @@ +name: tox +on: [push, pull_request] +jobs: + tox: + strategy: + fail-fast: false + max-parallel: 4 + matrix: + python: [3.6, 3.7, 3.8, 3.9] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - run: pip install tox + - if: matrix.python == '3.6' + run: TOXENV=py36 tox + - if: matrix.python == '3.7' + run: TOXENV=py37 tox + - if: matrix.python == '3.8' + run: TOXENV=py38 tox + - if: matrix.python == '3.9' + run: TOXENV=py39 tox diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9d4bc2a6..00000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: python - -jobs: - include: - - python: 3.9 - env: TOXENV=py39 - - python: 3.8 - env: TOXENV=py38 - - python: 3.7 - env: TOXENV=py37 - - python: 3.6 - env: TOXENV=py36 - - python: 3.5 - env: TOXENV=py35 - -install: - - git clone https://github.com/eclipse/paho.mqtt.testing.git || true - - pip install tox - -script: - - tox