Skip to content

Update README.md

Update README.md #49

name: Django Project CI & Postgres Test
on:
workflow_call:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
django_project_test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend/app/
env:
DJANGO_SECRET_KEY: ${{ secrets.DJANGO_SECRITY_KEY }}
POSTGRES_DB: parvaz
POSTGRES_PASSWORD: parvaz2324
POSTGRES_USER: parvaz
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
DB_IGNORE_SSL: "true"
services:
postgres:
image: postgres:15
env:
POSTGRES_DB: ${{ env.POSTGRES_DB}}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD}}
POSTGRES_USER: ${{ env.POSTGRES_USER}}
ports:
- 5432:5432
redis:
image: redis:latest
env:
REDIS_HOST: localhost
REDIS_PORT: 6379
ports:
- 6379:6379
strategy:
max-parallel: 4
matrix:
python-version: [3.10.7]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Install Dependencies
run: |
pip install poetry \
&& poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi
- name: Run Test
env:
REDIS_HOST: localhost
REDIS_PORT: 6379
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_STORAGE_BUCKET_NAME: ${{ secrets.AWS_STORAGE_BUCKET_NAME }}
run: |
python manage.py test