generated from ita-social-projects/DevTemplate
-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (53 loc) · 1.48 KB
/
django_ci.yml
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
name: Django CI
on:
workflow_dispatch
# push:
# branches: ["main"]
# pull_request:
# branches: ["main"]
env:
DEBUG: ${{ vars.DEV_DEBUG }}
SECRET_KEY: ${{ secrets.DEV_SECRET_KEY }}
ENGINE: ${{ vars.ENGINE }}
DB_HOST: 127.0.0.1
DB_PORT: ${{ vars.POSTGRES_PORT }}
PG_DB: ${{ vars.DEV_DB }}
PG_USER: ${{ vars.POSTGRES_USER }}
PG_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_DB: ${{ vars.POSTGRES_DB }}
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ["3.10"]
services:
postgres:
image: postgres:14
env:
POSTGRES_DB: db
POSTGRES_USER: ${{ vars.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
pip install --upgrade pip
pip install -r ./requirements.txt
- name: Run migrations
run: python manage.py migrate
- name: Run Tests
run: python manage.py test