Skip to content

Commit 324a23f

Browse files
committed
👷 GH actions updated to use poetry
1 parent 5d90588 commit 324a23f

File tree

2 files changed

+31
-32
lines changed

2 files changed

+31
-32
lines changed

.github/workflows/python-app.yml

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,41 @@ name: Python CI/CD
55

66
on:
77
push:
8-
branches: [ master ]
8+
branches: [master]
99
pull_request:
10-
branches: [ master ]
10+
branches: [master]
1111

1212
jobs:
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.6.13
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: 3.6.13
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
@@ -55,5 +54,5 @@ jobs:
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>!"

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.6.13 as base
1+
FROM python:3.8.0 as base
22

33
# copy our project code
44
COPY ./requirements.txt /app/requirements.txt

0 commit comments

Comments
 (0)