-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (60 loc) · 1.67 KB
/
testing-project.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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