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..e69c11e 100644 --- a/.github/workflows/autotest.yml +++ b/.github/workflows/autotest.yml @@ -1,4 +1,4 @@ -name: CI workflow +name: test on: # this workflow triggered on below condition [push, pull_request] diff --git a/.github/workflows/main.yml b/.github/workflows/flake8.yml similarity index 65% rename from .github/workflows/main.yml rename to .github/workflows/flake8.yml index bbca626..10069d2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/flake8.yml @@ -1,31 +1,32 @@ -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: [ '*' ] + +# cancel previous similar workflow runs +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true 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