@@ -5,42 +5,41 @@ name: Python CI/CD
5
5
6
6
on :
7
7
push :
8
- branches : [ master ]
8
+ branches : [main ]
9
9
pull_request :
10
- branches : [ master ]
10
+ branches : [main ]
11
11
12
12
jobs :
13
13
ci :
14
-
15
14
runs-on : ubuntu-latest
16
15
17
16
steps :
18
- - uses : actions/checkout@v2
19
- - name : Set up Python 3.6.13
20
- uses : actions/setup-python@v2
21
- with :
22
- python-version : 3.6.13
23
-
24
- - name : Install dependencies
25
- run : |
26
- python -m pip install --upgrade pip
27
- pip install flake8 pytest
28
- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
29
-
30
- - name : Lint with flake8
31
- run : |
32
- # stop the build if there are Python syntax errors or undefined names
33
- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
34
- # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
35
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
36
-
37
- - name : Format with black
38
- run : |
39
- black .
40
-
41
- - name : Test with pytest
42
- run : |
43
- pytest
17
+ - uses : actions/checkout@v2
18
+ - name : Set up Python 3.8.0
19
+ uses : actions/setup-python@v2
20
+ with :
21
+ python-version : 3.8.0
22
+
23
+ - name : Install dependencies
24
+ run : |
25
+ python -m pip install --upgrade pip
26
+ pip3 install poetry
27
+ poetry install
28
+
29
+ - name : Lint with flake8
30
+ run : |
31
+ # stop the build if there are Python syntax errors or undefined names
32
+ poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
33
+ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
34
+ poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
35
+
36
+ - name : Format with black
37
+ run : |
38
+ poetry run black .
39
+
40
+ - name : Test with pytest
41
+ run : |
42
+ poetry run pytest
44
43
45
44
build-push-image :
46
45
name : Build docker image and push
55
54
needs : build-push-image
56
55
runs-on : ubuntu-latest
57
56
steps :
58
- - name : Simple echo placeholder for now
59
- run : echo "deployed to <YOUR CLOUD PROVIDER>!"
57
+ - name : Simple echo placeholder for now
58
+ run : echo "deployed to <YOUR CLOUD PROVIDER>!"
0 commit comments