Skip to content

Commit 1226d61

Browse files
committed
ci: TT-394 create file python-package.yml
1 parent d536b4c commit 1226d61

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Python Package using Conda
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
pull_request:
9+
branches:
10+
- master
11+
12+
jobs:
13+
build-linux:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
max-parallel: 5
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Set up Python 3.7
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: 3.7
24+
- name: Add conda to system path
25+
run: |
26+
# $CONDA is an environment variable pointing to the root of the miniconda directory
27+
echo $CONDA/bin >> $GITHUB_PATH
28+
- name: Install dependencies
29+
run: |
30+
conda env update --file environment.yml --name base
31+
pip install -r V2/requirements.txt
32+
- name: Lint with flake8
33+
run: |
34+
conda install flake8
35+
cd V2
36+
# stop the build if there are Python syntax errors or undefined names
37+
#flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
38+
flake8 . --show-source --statistics
39+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
40+
#flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
41+
- name: Test with pytest
42+
run: |
43+
conda install pytest
44+
pytest

V2/.flake8

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[flake8]
2+
exclude = .git,__pycache__,./node_modules
3+
max-complexity = 10
4+
max_line_length = 120

V2/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ azure-functions-worker
44

55
# Tests
66
pytest
7+
flake8==4.0.1
78

89
# Mocking
910
pytest-mock

0 commit comments

Comments
 (0)