|
1 | | -name: CI process for time-tracker-bk app |
| 1 | +name: Python Package using Conda |
2 | 2 |
|
3 | | -on: |
4 | | - pull_request: |
5 | | - types: [opened, edited, reopened] |
6 | | - branches: |
7 | | - - master |
8 | | - #push: |
9 | | - #branches: [ master ] |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master ] |
10 | 6 |
|
11 | 7 | jobs: |
12 | | - ci-test: |
13 | | - name: Unit tests and linting |
14 | | - runs-on: ubuntu-latest |
| 8 | + build-linux: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + strategy: |
| 11 | + max-parallel: 5 |
15 | 12 |
|
16 | | - steps: |
17 | | - - uses: actions/checkout@master |
18 | | - - name: Initialize Python 3.7 |
19 | | - uses: actions/setup-python@v1 |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v2 |
| 15 | + - name: Set up Python 3.7 |
| 16 | + uses: actions/setup-python@v2 |
20 | 17 | with: |
21 | | - python-version: 3.7 |
22 | | - - name: Install dependencies |
| 18 | + python-version: 3.7 |
| 19 | + - name: Add conda to system path |
23 | 20 | run: | |
24 | | - python -m pip install --upgrade pip |
25 | | - pip install flake8 |
26 | | - pip install -r V2/requirements.txt |
27 | | - - name: Lint with flake8 |
| 21 | + # $CONDA is an environment variable pointing to the root of the miniconda directory |
| 22 | + echo $CONDA/bin >> $GITHUB_PATH |
| 23 | + - name: Install dependencies |
28 | 24 | run: | |
29 | | - # stop the build if there are Python syntax errors or undefined names |
30 | | - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
31 | | - # exit-zero treats all errors as warnings. |
32 | | - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
33 | | - #- name: Build binary wheel and a source tarball |
34 | | - #run: python setup.py sdist |
35 | | - # - name: Publish distribution to Test PyPI |
36 | | - # uses: pypa/gh-action-pypi-publish@master |
37 | | - # with: |
38 | | - # password: ${{ secrets.test_pypi_password }} |
39 | | - # repository_url: https://test.pypi.org/legacy/ |
| 25 | + conda env update --file environment.yml --name base |
| 26 | + pip install -r V2/requirements.txt |
| 27 | + - name: Lint with flake8 |
| 28 | + run: | |
| 29 | + conda install flake8 |
| 30 | + # stop the build if there are Python syntax errors or undefined names |
| 31 | + #flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
| 32 | + flake8 . --show-source --statistics |
| 33 | + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
| 34 | + #flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
| 35 | + - name: Test with pytest |
| 36 | + run: | |
| 37 | + conda install pytest |
| 38 | + pytest |
0 commit comments