From 096679433f1b8b95fff90c62db53a29235531a5e Mon Sep 17 00:00:00 2001 From: Anthony Le <87265509+AnthonyLe93@users.noreply.github.com> Date: Fri, 29 Jul 2022 22:14:28 +0100 Subject: [PATCH 1/4] ci.yml --- .github/workflows/python-package.yml | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 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..6b8edd6 --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,40 @@ +# 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: + fail-fast: false + matrix: + python-version: ["3.8", "3.9", "3.10"] + + steps: + - uses: actions/checkout@v3 + - 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 + - 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 203e9c6f8a440954f45fa4c8cc3588b510c85e04 Mon Sep 17 00:00:00 2001 From: Anthony Le <87265509+AnthonyLe93@users.noreply.github.com> Date: Fri, 29 Jul 2022 22:16:45 +0100 Subject: [PATCH 2/4] Update python-package.yml --- .github/workflows/python-package.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 6b8edd6..d48b201 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -31,8 +31,6 @@ jobs: 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 From 7a78169800e0f40ca2f57a0016f1b858edaeb389 Mon Sep 17 00:00:00 2001 From: Anthony Le <87265509+AnthonyLe93@users.noreply.github.com> Date: Fri, 29 Jul 2022 22:18:32 +0100 Subject: [PATCH 3/4] Update python-package.yml --- .github/workflows/python-package.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index d48b201..17b07d1 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -29,10 +29,6 @@ jobs: 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: | - # 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 c67068bfe9b9a233a97d2a1ae391b16f3bd8f574 Mon Sep 17 00:00:00 2001 From: Anthony Le <87265509+AnthonyLe93@users.noreply.github.com> Date: Fri, 29 Jul 2022 22:21:01 +0100 Subject: [PATCH 4/4] Update python-package.yml --- .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 17b07d1..3328f90 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -29,6 +29,9 @@ jobs: python -m pip install --upgrade pip python -m pip install flake8 pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Test with pytest + - name: Lint with flake8 run: | - pytest + # 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