infra!: added CI/CD pipeline and made various improvements
CI/CD Awesome Pipeline / Test (push) Successful in 1m37s
CI/CD Awesome Pipeline / Build & Push to Registry (push) Has been skipped

This commit is contained in:
2025-12-21 08:50:09 +01:00
parent ffd2678c91
commit afc0024b37
3 changed files with 79 additions and 3 deletions
+24 -3
View File
@@ -1,6 +1,7 @@
# Dockerfile for Agent Media
# Multi-stage build for smaller image size
ARG PYTHON_VERSION=3.14.2
ARG PYTHON_VERSION
ARG PYTHON_VERSION_SHORT
ARG RUNNER
# ===========================================
# Stage 1: Builder
@@ -39,7 +40,27 @@ RUN --mount=type=cache,target=/root/.cache/pip \
fi
# ===========================================
# Stage 2: Runtime
# Stage 2: Testing
# ===========================================
FROM builder as test
RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=cache,target=/root/.cache/pypoetry \
--mount=type=cache,target=/root/.cache/uv \
if [ "$RUNNER" = "poetry" ]; then \
poetry install --no-root; \
elif [ "$RUNNER" = "uv" ]; then \
uv pip install --system -e .[dev]; \
fi
COPY agent/ ./agent/
COPY application/ ./application/
COPY domain/ ./domain/
COPY infrastructure/ ./infrastructure/
COPY tests/ ./tests/
COPY app.py .
# ===========================================
# Stage 3: Runtime
# ===========================================
FROM python:${PYTHON_VERSION}-slim-bookworm as runtime
@@ -69,7 +90,7 @@ USER appuser
WORKDIR /home/appuser/app
# Copy Python packages from builder stage
COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
COPY --from=builder /usr/local/lib/${PYTHON_VERSION_SHORT}/site-packages /usr/local/lib/${PYTHON_VERSION_SHORT}/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin
# Copy application code (already owned by appuser)
+1
View File
@@ -47,6 +47,7 @@ addopts = [
#"--cov-report=xml", # Génère un rapport XML (pour CI/CD)
#"--cov-fail-under=80", # Échoue si coverage < 80%
"-n=auto", # --numprocesses=auto : parallélise les tests (pytest-xdist)
"--dist=loadscope", # Distribution strategy: group tests by module
"--strict-markers", # Erreur si un marker non déclaré est utilisé
"--disable-warnings", # Désactive l'affichage des warnings (sauf erreurs)
]