Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: ['3.12']
postgres-version: ['14', '15', '16']

services:
postgres:
image: postgres:${{ matrix.postgres-version }}
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: helios
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

env:
PGHOST: localhost
PGUSER: postgres

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libldap2-dev libsasl2-dev

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip freeze

- name: Run tests
run: python -Wall manage.py test -v 2 --settings=settings_ci
46 changes: 0 additions & 46 deletions .travis.yml

This file was deleted.

16 changes: 16 additions & 0 deletions settings_ci.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# CI-specific settings that override database configuration for GitHub Actions
from settings import *

# Override database settings for CI environment
# This is needed because the main settings.py ignores environment variables during testing
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'helios',
'HOST': 'localhost',
'PORT': '5432',
'USER': 'postgres',
'PASSWORD': 'postgres',
'CONN_MAX_AGE': 600,
},
}