45 lines
962 B
YAML
45 lines
962 B
YAML
kind: pipeline
|
|
type: docker
|
|
name: python-ci
|
|
|
|
trigger:
|
|
event:
|
|
- push
|
|
- pull_request
|
|
|
|
steps:
|
|
# Étape 1 : Installer les dépendances
|
|
- name: install-dependencies
|
|
image: python:3.10-slim
|
|
commands:
|
|
- pip install -r requirements.txt
|
|
|
|
# Étape 2 : Linting (vérification du style de code)
|
|
- name: lint
|
|
image: python:3.10-slim
|
|
commands:
|
|
- pip install flake8
|
|
- flake8 . --max-line-length=88
|
|
|
|
# Étape 3 : Tests unitaires
|
|
- name: run-tests
|
|
image: python:3.10-slim
|
|
commands:
|
|
- pip install -r requirements.txt
|
|
- pytest tests/
|
|
|
|
# Étape 4 : Tests d'intégration (si applicable)
|
|
- name: integration-tests
|
|
image: python:3.10-slim
|
|
commands:
|
|
- pip install -r requirements.txt
|
|
- python integration_tests.py
|
|
|
|
# Étape 5 : Analyse des vulnérabilités (optionnel)
|
|
- name: security-check
|
|
image: python:3.10-slim
|
|
commands:
|
|
- pip install bandit
|
|
- bandit -r .
|
|
|