From 8337e41d75144de7de58cf7c426812e45d145a31 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Tue, 28 Jul 2020 15:39:39 +0100 Subject: [PATCH] Final clean ups. It works! So, yes, need refs/remotes/origin/ prepended to the base_ref, which will always be a branch for a PR. * Remove debug lines (set -x, etc). * No need for pytest here as yet. * Fall back to requirements.txt if no requirements-dev.txt. --- .github/workflows/pr-checks.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index a03fff4a..7e1c6836 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -38,19 +38,14 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest - if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi + pip install flake8 + if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; elif [ -f requirements.txt ]; then pip install -r requirements.txt ; fi - name: Lint with flake8 env: BASE_REF: ${{github.base_ref}} run: | - # Show all commands as run - set -x - git branch - git log | head -100 - git diff # stop the build if there are Python syntax errors or undefined names, ignore existing git diff "refs/remotes/origin/${BASE_REF}" -- | flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --diff # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide