From 53768717b7f3749533b12b3be57e673b806e0d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9C=D0=B0=D1=80?= =?UTF-8?q?=D1=8E=D1=84=D0=B8=D1=87?= Date: Sat, 20 Mar 2021 18:44:35 +0300 Subject: [PATCH 1/6] setub github actions --- .github/workflows/python-package.yml | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/python-package.yml diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 0000000..e608c75 --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,39 @@ +# 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: Python package + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.6] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + 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 + - 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 + # 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: | + pytest From b6d590a76ff08e72da059ebad6afe8eaa76a7f54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9C=D0=B0=D1=80?= =?UTF-8?q?=D1=8E=D1=84=D0=B8=D1=87?= Date: Sat, 20 Mar 2021 18:50:03 +0300 Subject: [PATCH 2/6] fail if check doesn't work --- .github/workflows/python-package.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index e608c75..33c8a59 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -28,12 +28,15 @@ jobs: python -m pip install --upgrade pip python -m pip install flake8 pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + exit $? - 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 + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics || EXIT_STATUS=$? # 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 + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics || EXIT_STATUS=$? + exit $EXIT_STATUS - name: Test with pytest run: | pytest + exit $? From 829a085d631f9c791f8b93ca6cabbd9d5cdf3814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9C=D0=B0=D1=80?= =?UTF-8?q?=D1=8E=D1=84=D0=B8=D1=87?= Date: Sat, 20 Mar 2021 18:55:00 +0300 Subject: [PATCH 3/6] Update python-package.yml --- .github/workflows/python-package.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 33c8a59..9f46026 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -31,12 +31,16 @@ jobs: exit $? - name: Lint with flake8 run: | + EXIT_STATUS=0 # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics || EXIT_STATUS=$? # 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 || EXIT_STATUS=$? + echo $EXIT_STATUS exit $EXIT_STATUS - name: Test with pytest run: | - pytest + EXIT_STATUS=0 + pytest || EXIT_STATUS=$? + echo $EXIT_STATUS exit $? From 0b7c915688c3098128665817bca2522869b7697c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9C=D0=B0=D1=80?= =?UTF-8?q?=D1=8E=D1=84=D0=B8=D1=87?= Date: Sat, 20 Mar 2021 18:59:06 +0300 Subject: [PATCH 4/6] Update python-package.yml --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 9f46026..9da80db 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -37,7 +37,7 @@ jobs: # 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 || EXIT_STATUS=$? echo $EXIT_STATUS - exit $EXIT_STATUS + exit 1 - name: Test with pytest run: | EXIT_STATUS=0 From dd1e120744dc6e2f0333767762c809a1da649876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9C=D0=B0=D1=80?= =?UTF-8?q?=D1=8E=D1=84=D0=B8=D1=87?= Date: Sat, 20 Mar 2021 19:01:52 +0300 Subject: [PATCH 5/6] Update python-package.yml --- .github/workflows/python-package.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 9da80db..a881dfd 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -36,11 +36,12 @@ jobs: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics || EXIT_STATUS=$? # 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 || EXIT_STATUS=$? - echo $EXIT_STATUS - exit 1 + echo "exis status" + echo$"EXIT_STATUS" + exit $"EXIT_STATUS" - name: Test with pytest run: | EXIT_STATUS=0 pytest || EXIT_STATUS=$? echo $EXIT_STATUS - exit $? + exit $EXIT_STATUS From f6f7b5ffd6724b8fd44093462b033082f2f649e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9C=D0=B0=D1=80?= =?UTF-8?q?=D1=8E=D1=84=D0=B8=D1=87?= Date: Sat, 20 Mar 2021 19:03:36 +0300 Subject: [PATCH 6/6] Update python-package.yml --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index a881dfd..bd138b4 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -37,7 +37,7 @@ jobs: # 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 || EXIT_STATUS=$? echo "exis status" - echo$"EXIT_STATUS" + echo $"EXIT_STATUS" exit $"EXIT_STATUS" - name: Test with pytest run: |