@@ -5,42 +5,41 @@ name: Python CI/CD
55
66on :
77 push :
8- branches : [ master ]
8+ branches : [main ]
99 pull_request :
10- branches : [ master ]
10+ branches : [main ]
1111
1212jobs :
1313 ci :
14-
1514 runs-on : ubuntu-latest
1615
1716 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
4443
4544 build-push-image :
4645 name : Build docker image and push
5554 needs : build-push-image
5655 runs-on : ubuntu-latest
5756 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