Skip to content

Update testing-project.yaml #20

Update testing-project.yaml

Update testing-project.yaml #20

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 }}
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 }}
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:
- 6380: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
run: |
export 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 }} \
&& python manage.py test