From 13dc29751dbb1b20e443153aef99b6a311841b48 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Thu, 14 Sep 2023 11:51:14 -0400 Subject: [PATCH 1/4] update flake8 --- .flake8 | 10 ++++++++++ .github/workflows/autotest.yml | 4 ++-- .github/workflows/main.yml | 16 ++++++---------- 3 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 .flake8 diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..43e2629 --- /dev/null +++ b/.flake8 @@ -0,0 +1,10 @@ +[flake8] +exclude = + .git, + __pycache__, + build, + dist, + env, + venv, +max-line-length = 127 +max-complexity=10 \ No newline at end of file diff --git a/.github/workflows/autotest.yml b/.github/workflows/autotest.yml index bbca626..58634dc 100644 --- a/.github/workflows/autotest.yml +++ b/.github/workflows/autotest.yml @@ -1,11 +1,11 @@ -name: CI workflow +name: test on: # this workflow triggered on below condition [push, pull_request] push: branches: [ master ] pull_request: - branches: [ master ] + branches: [ '*' ] jobs: build: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bbca626..d515e9b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,31 +1,27 @@ -name: CI workflow +name: flake8 on: # this workflow triggered on below condition [push, pull_request] push: - branches: [ master ] + branches: [ main ] pull_request: - branches: [ master ] + branches: [ '*' ] jobs: build: runs-on: ubuntu-latest - strategy: - matrix: - python-version: [3.5, 3.6, 3.7, 3.8] steps: - uses: actions/checkout@v2 - - name: Set up python ${{ matrix.python-version }} + - name: Set up python uses: actions/setup-python@v2 with: - python-version: ${{ matrix.python-version }} + python-version: "3.11" - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install flake8 - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names From 44d64c17a2c3edd4689ab7269c8b49d14b4258bb Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Thu, 14 Sep 2023 11:51:34 -0400 Subject: [PATCH 2/4] rename --- .github/workflows/{main.yml => flake8.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{main.yml => flake8.yml} (100%) diff --git a/.github/workflows/main.yml b/.github/workflows/flake8.yml similarity index 100% rename from .github/workflows/main.yml rename to .github/workflows/flake8.yml From 37446179cd982cb1b45201335a7e3130ee4ee7c0 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Thu, 14 Sep 2023 11:57:36 -0400 Subject: [PATCH 3/4] do not run tests on this PR --- .github/workflows/autotest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autotest.yml b/.github/workflows/autotest.yml index 58634dc..e69c11e 100644 --- a/.github/workflows/autotest.yml +++ b/.github/workflows/autotest.yml @@ -5,7 +5,7 @@ on: push: branches: [ master ] pull_request: - branches: [ '*' ] + branches: [ master ] jobs: build: From 7bea76b4822aa8c9e9e1f65b41c98d83fcba78b5 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Thu, 14 Sep 2023 11:58:54 -0400 Subject: [PATCH 4/4] cancel previous workflows --- .github/workflows/flake8.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index d515e9b..10069d2 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -7,6 +7,11 @@ on: pull_request: branches: [ '*' ] +# cancel previous similar workflow runs +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build: