From 9fe0ae5b8863cb67630537c5b6d51704177ab70f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20Kiiskil=C3=A4?= Date: Fri, 20 Oct 2023 16:34:20 +0300 Subject: [PATCH] PR-check: require clean flake8, add no findings notes We have a clean flake8 status now, so let's not check if more was injected - just fail if any are found. --- .github/workflows/pr-checker.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr-checker.yml b/.github/workflows/pr-checker.yml index f246e12..09e3eff 100644 --- a/.github/workflows/pr-checker.yml +++ b/.github/workflows/pr-checker.yml @@ -39,6 +39,8 @@ jobs: echo "Misspell has findings, fail." echo "TEST_FAIL=true" >> $GITHUB_ENV exit 1 + else + echo "No findings." fi - name: Run pylint (findings may not increase) @@ -58,7 +60,7 @@ jobs: echo "TEST_FAIL=true" >> $GITHUB_ENV exit 1 fi - - name: Run flake8 (findings may not increase) + - name: Run flake8 if: always() run: | sudo apt-get install flake8 @@ -66,15 +68,14 @@ jobs: echo "Starting flake8..." flake8 --exit-zero --exclude=izuma_systest_lib/.eggs,scripts-internal --max-line-length=130 >flake8.log echo "### flake8" >>$SUMMARY_FILE - flakestats=$(scripts-internal/ci/more-lines-checker.sh ${{ github.event.repository.default_branch }} ${{ github.ref_name }} \ - "flake8 --exit-zero --exclude=systemtest-library/.eggs,scripts-internal --max-line-length=130" | tail -n2) - echo "$flakestats" >>$SUMMARY_FILE - echo "$flakestats" - if [[ $flakestats == *"Oh no"* ]]; then - # More findings than earlier + lines=$(wc -l < "flake8.log") + if [[ $lines -gt 0 ]]; then + echo "Flake8 has findings, fail." echo "TEST_FAIL=true" >> $GITHUB_ENV exit 1 - fi + else + echo "No findings." + fi - name: Archive production artifacts if: always()