Skip to content

Commit 033b466

Browse files
authored
Merge pull request #10 from omidcodes/010-add-github-actions-pipeline
add github action ci pipeline
2 parents 9a83cd0 + 5e593e9 commit 033b466

1 file changed

Lines changed: 72 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: CI Pipeline
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-test-lint:
11+
runs-on: ubuntu-latest
12+
13+
services:
14+
postgres:
15+
image: postgres:16
16+
env:
17+
POSTGRES_DB: taskflow
18+
POSTGRES_USER: postgres
19+
POSTGRES_PASSWORD: postgres
20+
ports:
21+
- 5432:5432
22+
options: >-
23+
--health-cmd="pg_isready"
24+
--health-interval=10s
25+
--health-timeout=5s
26+
--health-retries=5
27+
28+
rabbitmq:
29+
image: rabbitmq:3.12-management
30+
ports:
31+
- 5672:5672
32+
- 15672:15672
33+
34+
env:
35+
DEBUG: False
36+
SECRET_KEY: dummy-key
37+
DJANGO_ALLOWED_HOSTS: localhost
38+
POSTGRES_DB: taskflow
39+
POSTGRES_USER: postgres
40+
POSTGRES_PASSWORD: postgres
41+
POSTGRES_HOST: localhost
42+
POSTGRES_PORT: 5432
43+
CELERY_BROKER_URL: amqp://guest:guest@localhost:5672//
44+
45+
steps:
46+
- uses: actions/checkout@v4
47+
48+
- name: Set up Python
49+
uses: actions/setup-python@v5
50+
with:
51+
python-version: '3.12'
52+
53+
- name: Install dependencies
54+
run: |
55+
python -m venv venv
56+
source venv/bin/activate
57+
pip install -r requirements.txt
58+
59+
- name: Run migrations
60+
run: |
61+
source venv/bin/activate
62+
python manage.py migrate
63+
64+
- name: Run tests
65+
run: |
66+
source venv/bin/activate
67+
pytest --disable-warnings
68+
69+
- name: Run Ruff Linter
70+
run: |
71+
source venv/bin/activate
72+
ruff check .

0 commit comments

Comments
 (0)