36 lines
828 B
YAML
36 lines
828 B
YAML
name: 🧪 Tests API - TP4
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, develop ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: 📥 Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: 🐳 Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: 🧪 Run tests with Docker Compose
|
|
run: |
|
|
echo "🚀 Démarrage des tests automatisés..."
|
|
docker-compose --profile test up --build --abort-on-container-exit test
|
|
|
|
- name: 📊 Show test results
|
|
if: always()
|
|
run: |
|
|
echo "📋 Résultats des tests:"
|
|
docker-compose --profile test logs test
|
|
|
|
- name: 🧹 Cleanup
|
|
if: always()
|
|
run: |
|
|
docker-compose --profile test down -v
|
|
docker system prune -f
|