build(deps): bump pytest from 9.0.3 to 9.1.0 in /ressources #67
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI/CD — NexaCloud API | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| # ── Job 1 : Qualité ──────────────────────────────────────────────── | |
| qualite: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - run: pip install -r ressources/requirements.txt | |
| - name: Lint | |
| run: flake8 ressources/ --config ressources/.flake8 | |
| - name: Tests | |
| run: pytest ressources/ -v --cov=ressources | |
| # ── Job 2 : Staging ─────────────────────────────────────────────── | |
| staging: | |
| runs-on: ubuntu-latest | |
| needs: qualite # attend que le job qualite réussisse | |
| environment: staging | |
| # if: github.ref_name == 'main' # uniquement sur la branche main | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Installer les dépendances | |
| run: pip install -r ressources/requirements.txt | |
| - name: Déployer sur Azure App Service (staging) | |
| uses: azure/webapps-deploy@v3 | |
| with: | |
| app-name: "ten-nexacloud-api-staging-20435" | |
| publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_STAGING }} | |
| package: ressources/ | |
| # Smoke test post-déploiement : vérifier que l'app répond avant de valider | |
| - name: Smoke test post-déploiement | |
| run: | | |
| sleep 30 # attendre que l'app démarre | |
| curl --fail https://ten-nexacloud-api-staging-20435.azurewebsites.net/health || exit 1 | |
| # Si ce test échoue, le job échoue → on peut déclencher un rollback | |
| # ── Job 3 : Production ──────────────────────────────────────────── | |
| production: | |
| runs-on: ubuntu-latest | |
| needs: staging | |
| environment: production | |
| # if: github.ref_name == 'main' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Installer les dépendances | |
| run: pip install -r ressources/requirements.txt | |
| - name: Déployer sur Azure App Service (production) | |
| uses: azure/webapps-deploy@v3 | |
| with: | |
| app-name: "ten-nexacloud-api-production-7324" | |
| publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_PRODUCTION }} | |
| package: ressources/ | |
| # Smoke test post-déploiement : vérifier que l'app répond avant de valider | |
| - name: Smoke test post-déploiement | |
| run: | | |
| sleep 30 # attendre que l'app démarre | |
| curl --fail https://ten-nexacloud-api-production-7324.azurewebsites.net/health || exit 1 |