Skip to content

✅(tooling-test) mv test_interface_aware_mock to web (#529) #15

✅(tooling-test) mv test_interface_aware_mock to web (#529)

✅(tooling-test) mv test_interface_aware_mock to web (#529) #15

Workflow file for this run

name: Web
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
types: [opened, synchronize, reopened, edited]
paths:
- "src/web/**"
permissions:
contents: read
jobs:
build-web:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./src/web
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.9.7"
enable-cache: true
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: "./src/web/.python-version"
- name: Install the project
run: uv sync --locked --all-extras --dev
lint-web:
needs: build-web
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./src/web
env:
WEB_SECRET_KEY: the_secret_key
WEB_DATABASE_URL: psql://web:pass@localhost:5432/web
DJANGO_SETTINGS_MODULE: config.settings.test
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.9.7"
enable-cache: true
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: "./src/web/.python-version"
- name: Lint with Ruff
run: uv run ruff check .
- name: Lint format with Ruff
run: uv run ruff format --check .
- name: Lint with MyPy
run: uv run mypy .
test-web:
needs: build-web
runs-on: ubuntu-latest
services:
postgresql:
image: pgvector/pgvector:pg16
env:
POSTGRES_DB: web
POSTGRES_USER: postgres
POSTGRES_PASSWORD: pass
TEST: true
options: >-
--health-cmd "pg_isready -h localhost -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 10
ports:
- 5432:5432
qdrant:
image: qdrant/qdrant:latest
ports:
- 6333:6333
redis:
image: redis
ports:
- 6379:6379
defaults:
run:
working-directory: ./src/web
env:
WEB_SECRET_KEY: the_secret_key
WEB_DATABASE_URL: psql://postgres:pass@localhost:5432/web
WEB_QDRANT_URL: http://localhost:6333
WEB_VECTOR_DB_TYPE: QDRANT
DJANGO_SETTINGS_MODULE: config.settings.test
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.9.7"
enable-cache: true
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: "./src/web/.python-version"
- name: Install dependencies
run: uv sync --locked --all-extras --dev
- name: Wait for Qdrant to be ready
run: |
echo "Waiting for Qdrant to be ready..."
for i in {1..30}; do
if curl -f http://localhost:6333 > /dev/null 2>&1; then
echo "✅ Qdrant is ready"
break
fi
echo "⏳ Waiting for Qdrant... (attempt $i/30)"
sleep 2
done
- name: Setup Qdrant collections
run: |
echo "Creating production collection..."
uv run python config/setup-qdrant.py
echo "Creating test collection..."
uv run python config/setup-qdrant.py --collection-name fonction_publique_test
- name: Test with pytest
run: uv run pytest -m "not accessibility and not e2e" .
- name: Install Playwright browser
run: uv run playwright install --with-deps chromium
- name: Test Web suite with coverage
run: uv run pytest -m "e2e" .
- name: Generate schema
run: uv run python manage.py spectacular --file presentation/static/schema.yaml --validate