39 lines
1.0 KiB
YAML
39 lines
1.0 KiB
YAML
name: ERP CI Pipeline
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
db:
|
|
image: postgres:16-alpine
|
|
env:
|
|
POSTGRES_DB: erp_db
|
|
POSTGRES_PASSWORD: password
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install -r backend/requirements.txt
|
|
pip install pytest pytest-django
|
|
|
|
- name: Run Unit Tests
|
|
env:
|
|
DATABASE_URL: postgres://postgres:password@localhost:5432/erp_db
|
|
run: |
|
|
# Pokrećemo testove iz našeg backend direktorija
|
|
pytest backend/modules/invoicing/tests/test_services.py
|
|
|
|
- name: Run Task Management Tests
|
|
env:
|
|
DATABASE_URL: postgres://postgres:password@localhost:5432/erp_db
|
|
run: |
|
|
pytest backend/modules/task_management/tests/test_services.py |