Skip to content

Commit 6af99b7

Browse files
CI updated with docker
1 parent 652369f commit 6af99b7

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.github/workflows/python-app.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,24 @@ jobs:
3131
python -m pip install --upgrade pip
3232
pip install -r requirements.txt
3333
34+
- name: Install Docker Compose
35+
run: |
36+
sudo apt-get update
37+
sudo apt-get install -y docker-compose
38+
3439
- name: Lint with flake8
3540
run: |
3641
# stop the build if there are Python syntax errors or undefined names
3742
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
3843
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
3944
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
4045
41-
- name: Test with pytest
46+
- name: Building Docker containers
47+
run: |
48+
docker-compose up -d --build
49+
50+
- name: Run tests
4251
run: |
43-
pytest
52+
docker-compose exec -T app pytest -v --disable-warnings --maxfail=1
4453
4554

src/app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class InputData(BaseModel):
5656
async def root():
5757
return {"Welcome to our ML application."}
5858

59+
5960
@app.post('/predict')
6061
async def predict(data: InputData):
6162
""" Predict the OutletSales based on the input data """

0 commit comments

Comments
 (0)