From c2a848cf6cdd2cfb6d09a541d1215a494e73a057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Mon, 24 Aug 2020 11:42:45 +0700 Subject: [PATCH] Set up GitHub Action for linting This will give faster linting feedback since we can skip compilation. --- .github/workflows/lint.yml | 27 +++++++++++++++++++++++++++ tox.ini | 10 ++++++---- 2 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..a3bd0ca --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,27 @@ +name: lint + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: 3.9.0-beta.4 - 3.9.0 + + - name: Install tox + run: python -m pip install tox + + - name: Main check + run: python -m tox -e lint diff --git a/tox.ini b/tox.ini index 400cc4f..317d3b6 100644 --- a/tox.ini +++ b/tox.ini @@ -7,14 +7,16 @@ isolated_build = True deps = Cython scipy - flake8 pytest-cov -commands = - flake8 - pytest +commands = pytest setenv = CYTHON_TRACE = 1 passenv = TRAVIS +[testenv:lint] +skip_install = true +deps = flake8 +commands = flake8 + [flake8] filename = *.pxd, *.pyx, *.py hang-closing = True