Skip to content

Commit

Permalink
CI 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
riroan committed Aug 24, 2024
1 parent 8c9b985 commit 1bcfca7
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 6 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Check out repository code
uses: actions/checkout@v3

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Check lint
run: |
pre-commit run --all-files
- name: Build docker image
run: |
docker build -t pangtok:latest .
- name: Run tests in docker container
run: |
docker run --rm pangtok:latest python -m pytest
2 changes: 1 addition & 1 deletion service/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async def show_product(
dislike_user_ids = [
like.user_id for like in likes if like.is_like == LikeStatus.DISLIKE
]

return ProductResponseDto.from_entity(
product=product,
like_count=len(like_user_ids),
Expand Down
10 changes: 5 additions & 5 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ class Settings(BaseSettings):
env_file='.env', env_file_encoding='utf-8'
)

db_name: str
db_user: str
db_password: str
db_host: str
db_port: int
db_name: str = str()
db_user: str = str()
db_password: str = str()
db_host: str = str()
db_port: int = int()

def get_db_url(self):
return URL.create(
Expand Down

0 comments on commit 1bcfca7

Please sign in to comment.