Skip to content

Commit 1d28ee4

Browse files
committed
Add Django CI workflow for bookings testing
1 parent d9f66ee commit 1d28ee4

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

.github/workflows/django.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Django CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
services:
14+
postgres:
15+
image: postgres:13
16+
env:
17+
POSTGRES_USER: postgres
18+
POSTGRES_PASSWORD: postgres
19+
POSTGRES_DB: mydb
20+
ports:
21+
- 5432:5432
22+
options: >-
23+
--health-cmd="pg_isready -U postgres"
24+
--health-interval=10s
25+
--health-timeout=5s
26+
--health-retries=5
27+
28+
env:
29+
DATABASE_URL: postgres://postgres:postgres@localhost:5432/mydb
30+
31+
steps:
32+
- uses: actions/checkout@v3
33+
34+
- name: Set up Python
35+
uses: actions/setup-python@v4
36+
with:
37+
python-version: [3.11, 3.12]
38+
39+
- name: Install dependencies
40+
run: |
41+
python -m pip install --upgrade pip
42+
pip install -r requirements.txt
43+
44+
- name: Run migrations
45+
run: python manage.py migrate
46+
47+
- name: Run Booking Test
48+
run: python manage.py test bookings

0 commit comments

Comments
 (0)