Skip to content

One more CI fix

One more CI fix #5

Workflow file for this run

name: Quality Gate
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
lint-and-static-checks:
runs-on: ubuntu-latest
strategy:
matrix:
check: [lint, format-check, type-check, security]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run ${{ matrix.check }}
run: |
if [ "${{ matrix.check }}" = "lint" ]; then
ruff check .
elif [ "${{ matrix.check }}" = "format-check" ]; then
ruff format --check .
elif [ "${{ matrix.check }}" = "type-check" ]; then
mypy genealogy genealogy_extractor --config-file pyproject.toml
elif [ "${{ matrix.check }}" = "security" ]; then
bandit -r genealogy genealogy_extractor -f txt -c .bandit
fi
django-tests:
runs-on: ubuntu-latest
strategy:
matrix:
check: [django-check, test]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up environment variables
run: |
cat > .env << EOF
DJANGO_SECRET_KEY=test-secret-key-for-ci
DEBUG=False
DB_HOST=db
DB_NAME=genealogy_extractor
DB_USER=postgres
DB_PASSWORD=postgres
DB_PORT=5432
REDIS_HOST=redis
REDIS_PORT=6379
DJANGO_SUPERUSER_USERNAME=admin
DJANGO_SUPERUSER_PASSWORD=admin
DJANGO_SUPERUSER_EMAIL=admin@localhost
EOF
- name: Build and start services
run: docker compose up -d --build
- name: Wait for services to be ready
run: |
echo "Waiting for services to be ready..."
timeout 60 bash -c 'until docker compose ps | grep -q "web.*Up"; do sleep 2; done'
sleep 5
- name: Run ${{ matrix.check }}
run: make ${{ matrix.check }}