From 7ba9a63bd1d34d4c446516fc00957772b2bc85d0 Mon Sep 17 00:00:00 2001 From: Alho Markku J Date: Tue, 27 Aug 2024 14:57:20 +0300 Subject: [PATCH] Linter as a jobstep, continue-on-error? --- .github/workflows/python_import.yml | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.github/workflows/python_import.yml b/.github/workflows/python_import.yml index 9c3e945f..135f8dee 100644 --- a/.github/workflows/python_import.yml +++ b/.github/workflows/python_import.yml @@ -36,3 +36,38 @@ jobs: # - name: Test with pytest # run: | # pytest + + lint: + + runs-on: ubuntu-latest + continue-on-error: true + strategy: + fail-fast: false + # matrix: + # python-version: ["3.7", "3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python #${{ matrix.python-version }} + uses: actions/setup-python@v3 + # with: + # python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + python -m pip install numpy scipy matplotlib scikit-image # add versions to matrix + - name: Lint with flake8 + # uses: + # with: + # conclusion: neutral + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # 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 + if: always() + # - name: Linter result only for reference + + \ No newline at end of file