Skip to content

Commit d7500b2

Browse files
authored
Merge pull request #21 from jmeisele/jason/fix-ci
👷 GH actions updated to use poetry
2 parents 5d90588 + 72fd194 commit d7500b2

File tree

4 files changed

+134
-33
lines changed

4 files changed

+134
-33
lines changed

.github/workflows/python-app.yml

+30-31
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: [main]
99
pull_request:
10-
branches: [ master ]
10+
branches: [main]
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.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
@@ -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

+1-1
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

poetry.lock

+102-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ flake8 = "^3.9.1"
1818
isort = "^5.8.0"
1919
black = "^21.4b2"
2020
autopep8 = "^1.5.7"
21+
pytest = "^7.1.2"
2122

2223
[build-system]
2324
requires = ["poetry-core>=1.0.0"]

0 commit comments

Comments
 (0)