Skip to content

wati_for_db 커스텀 커맨드 생성 및 테스트 코드 작성 #13

wati_for_db 커스텀 커맨드 생성 및 테스트 코드 작성

wati_for_db 커스텀 커맨드 생성 및 테스트 코드 작성 #13

Workflow file for this run

name: Django Mini Project CI
on:
push:
branches:
- main
pull_request:
jobs:
ci:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: django
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Set timezone to KST
run: |
sudo rm /etc/localtime
sudo ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "${HOME}/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
poetry install
- name: Run isort (Import sorting)
run: |
poetry run isort . --check --diff
- name: Run black (Code formatting)
run: |
poetry run black . --check
- name: Wait for PostgreSQL
run: |
poetry run python manage.py wait_for_db
- name: Run Django Migration
run: |
poetry run python manage.py makemigrations
poetry run python manage.py migrate
- name: Run Django tests
run: |
poetry run python manage.py test