Skip to content

Commit

Permalink
Merge pull request #21 from jmeisele/jason/fix-ci
Browse files Browse the repository at this point in the history
👷 GH actions updated to use poetry
  • Loading branch information
jmeisele authored Jul 20, 2022
2 parents 5d90588 + 72fd194 commit d7500b2
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 33 deletions.
61 changes: 30 additions & 31 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,41 @@ name: Python CI/CD

on:
push:
branches: [ master ]
branches: [main]
pull_request:
branches: [ master ]
branches: [main]

jobs:
ci:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.6.13
uses: actions/setup-python@v2
with:
python-version: 3.6.13

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Format with black
run: |
black .
- name: Test with pytest
run: |
pytest
- uses: actions/checkout@v2
- name: Set up Python 3.8.0
uses: actions/setup-python@v2
with:
python-version: 3.8.0

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip3 install poetry
poetry install
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Format with black
run: |
poetry run black .
- name: Test with pytest
run: |
poetry run pytest
build-push-image:
name: Build docker image and push
Expand All @@ -55,5 +54,5 @@ jobs:
needs: build-push-image
runs-on: ubuntu-latest
steps:
- name: Simple echo placeholder for now
run: echo "deployed to <YOUR CLOUD PROVIDER>!"
- name: Simple echo placeholder for now
run: echo "deployed to <YOUR CLOUD PROVIDER>!"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.6.13 as base
FROM python:3.8.0 as base

# copy our project code
COPY ./requirements.txt /app/requirements.txt
Expand Down
103 changes: 102 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ flake8 = "^3.9.1"
isort = "^5.8.0"
black = "^21.4b2"
autopep8 = "^1.5.7"
pytest = "^7.1.2"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down

0 comments on commit d7500b2

Please sign in to comment.