diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index e0397252..76e7ac8e 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -1,39 +1,41 @@ -name: CI process for time-tracker-bk app +name: Python Package using Conda on: pull_request: types: [opened, edited, reopened] - branches: + branches: - master - #push: - #branches: [ master ] jobs: - ci-test: - name: Unit tests and linting - runs-on: ubuntu-latest + build-linux: + runs-on: ubuntu-latest + strategy: + max-parallel: 5 - steps: - - uses: actions/checkout@master - - name: Initialize Python 3.7 - uses: actions/setup-python@v1 + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v2 with: - python-version: 3.7 - - name: Install dependencies + python-version: 3.7 + - name: Add conda to system path run: | - python -m pip install --upgrade pip - pip install flake8 - pip install -r V2/requirements.txt - - name: Lint with flake8 + # $CONDA is an environment variable pointing to the root of the miniconda directory + echo $CONDA/bin >> $GITHUB_PATH + - name: Install dependencies 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. - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - #- name: Build binary wheel and a source tarball - #run: python setup.py sdist - # - name: Publish distribution to Test PyPI - # uses: pypa/gh-action-pypi-publish@master - # with: - # password: ${{ secrets.test_pypi_password }} - # repository_url: https://test.pypi.org/legacy/ + 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 index ccd61824..208ae43f 100644 --- a/V2/.flake8 +++ b/V2/.flake8 @@ -1,4 +1,4 @@ [flake8] -exclude = .git,__pycache__, +exclude = .git,__pycache__,./node_modules max-complexity = 10 max_line_length = 120 \ No newline at end of file