From 7402be38beb8db25b533bb0db17b9af847c93e45 Mon Sep 17 00:00:00 2001 From: Paul Hobson Date: Thu, 20 Aug 2020 08:46:59 -0700 Subject: [PATCH] break out the linter into its own action --- .github/workflows/python-runlinter.yml | 33 +++++++++++++++++++++ .github/workflows/python-runtests-basic.yml | 8 +---- 2 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/python-runlinter.yml diff --git a/.github/workflows/python-runlinter.yml b/.github/workflows/python-runlinter.yml new file mode 100644 index 0000000..ded124e --- /dev/null +++ b/.github/workflows/python-runlinter.yml @@ -0,0 +1,33 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Lint with flake8 + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude .git,docs/* + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + diff --git a/.github/workflows/python-runtests-basic.yml b/.github/workflows/python-runtests-basic.yml index 5c225ff..f6228ac 100644 --- a/.github/workflows/python-runtests-basic.yml +++ b/.github/workflows/python-runtests-basic.yml @@ -26,14 +26,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest + pip install pytest if [ -f requirements_dev.txt ]; then pip install -r requirements_dev.txt; fi - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude .git,docs/* - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | python check_wqio.py --doctest-modules