Skip to content

Commit

Permalink
Create ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sejongpark committed Jan 20, 2024
1 parent 9f66c19 commit 56d8914
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: CI

on:
push:
branches: ["develop"]
pull_request:
branches: ["develop"]

env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
POSTGRES_DB: ${{ secrets.DB_USERNAME }}
POSTGRES_USER: ${{ secrets.DB_DATABASE }}
POSTGRES_PASSWORD: ${{ secrets.DB_USER_PASSWORD }}
DEVELOPER_KEY: ${{ secrets.DB_ROOT_PASSWORD }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

jobs:
backend:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.11

- name: Install pipenv
run: python -m pip install pipenv

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: ${{ runner.os }}-pipenv-

- name: Install dependencies
working-directory: backend
run: pipenv install

- name: Run tests
working-directory: backend
run: |
pipenv run python manage.py makemigrations
pipenv run python manage.py migrate
pipenv run python manage.py test
frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Cache frontend packages
uses: actions/cache@v3
with:
path: frontend/node_modules
key: ${{ runner.os }}-frontend-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: ${{ runner.os }}-frontend-

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install packages
working-directory: frontend
run: npm ci

0 comments on commit 56d8914

Please sign in to comment.