diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 00000000..76e7ac8e --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,41 @@ +name: Python Package using Conda + +on: + pull_request: + types: [opened, edited, reopened] + branches: + - master + +jobs: + build-linux: + runs-on: ubuntu-latest + strategy: + max-parallel: 5 + + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Add conda to system path + run: | + # $CONDA is an environment variable pointing to the root of the miniconda directory + echo $CONDA/bin >> $GITHUB_PATH + - name: Install dependencies + run: | + conda env update --file environment.yml --name base + pip install -r V2/requirements.txt + - name: Lint with flake8 + run: | + conda install flake8 + cd V2 + # stop the build if there are Python syntax errors or undefined names + #flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 . --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: | + conda install pytest + pytest \ No newline at end of file diff --git a/V2/.flake8 b/V2/.flake8 new file mode 100644 index 00000000..208ae43f --- /dev/null +++ b/V2/.flake8 @@ -0,0 +1,4 @@ +[flake8] +exclude = .git,__pycache__,./node_modules +max-complexity = 10 +max_line_length = 120 \ No newline at end of file diff --git a/V2/requirements.txt b/V2/requirements.txt index 41acba1d..c651bb35 100644 --- a/V2/requirements.txt +++ b/V2/requirements.txt @@ -4,6 +4,7 @@ azure-functions-worker # Tests pytest +flake8==4.0.1 # Mocking pytest-mock