-
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (55 loc) · 1.45 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
56
57
name: django-ci
on:
workflow_call:
workflow_dispatch:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]
jobs:
test:
runs-on: ubuntu-latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_HOST: localhost
POSTGRES_DB: djtesting
POSTGRES_PORT: 5432
DJANGO_SECRET_KEY: test-key
services:
postgres_main:
image: postgres:17
env:
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
POSTGRES_DB: ${{ env.POSTGRES_DB }}
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10.6
uses: actions/setup-python@v5
with:
python-version: '3.10.6'
- name: Setup sample .env
run: cp .env.defaults .env
- name: Install pip and poetry dependencies
run: |
pip install --upgrade pip
pip install poetry
poetry config virtualenvs.create true
poetry install --no-root
- name: Create directories
run: |
mkdir tmp
- name: Run Django Tests
env:
DJANGO_SETTINGS_MODULE: "app.settings.development"
PYTHONUNBUFFERED: 1
run: |
poetry run python manage.py test