70 lines
1.5 KiB
YAML
70 lines
1.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
django-tests:
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
env:
|
|
POSTGRES_DB: onoff
|
|
POSTGRES_USER: onoff
|
|
POSTGRES_PASSWORD: onoff
|
|
ports:
|
|
- 5432:5432
|
|
options: >-
|
|
--health-cmd="pg_isready -U onoff -d onoff"
|
|
--health-interval=10s
|
|
--health-timeout=5s
|
|
--health-retries=5
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
ports:
|
|
- 6379:6379
|
|
|
|
env:
|
|
DJANGO_SECRET_KEY: ci-secret-key
|
|
DJANGO_DEBUG: "0"
|
|
DJANGO_ALLOWED_HOSTS: localhost,127.0.0.1
|
|
POSTGRES_DB: onoff
|
|
POSTGRES_USER: onoff
|
|
POSTGRES_PASSWORD: onoff
|
|
POSTGRES_HOST: 127.0.0.1
|
|
POSTGRES_PORT: "5432"
|
|
REDIS_URL: redis://127.0.0.1:6379/0
|
|
CELERY_TASK_ALWAYS_EAGER: "1"
|
|
NEXTCLOUD_ENABLED: "0"
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: backend
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
cache: "pip"
|
|
cache-dependency-path: backend/requirements.txt
|
|
|
|
- name: Install dependencies
|
|
run: pip install -r requirements.txt
|
|
|
|
- name: Django system check
|
|
run: python manage.py check
|
|
|
|
- name: Migration drift check
|
|
run: python manage.py makemigrations --check --dry-run
|
|
|
|
- name: Run tests
|
|
run: python manage.py test workflows.tests -v 2
|