From 9cee6f1ed161e8247be87f2a5dcd2fc0a512ddec Mon Sep 17 00:00:00 2001 From: msaid-soighiri Date: Thu, 7 May 2026 16:56:56 +0200 Subject: [PATCH] Actualiser .gitea/workflows/ci.yml --- .gitea/workflows/ci.yml | 42 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index e69de29..2c1bd70 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI-CD NDF Complet +run-name: Pipeline exécuté par ${{ github.actor }} + +on: + push: + branches: + - master + +jobs: + test-and-quality: + runs-on: ubuntu-latest + steps: + - name: Récupération du code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + # 1. ÉTAPE DES TESTS (Obligatoire pour un bon rapport Sonar) + - name: Installation et Tests Node.js + run: | + npm install + npm test -- --coverage --watchAll=false + + # 2. ÉTAPE SONARQUBE + - name: Analyse SonarQube + uses: sonarsource/sonarqube-scan-action@master + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + with: + args: > + -Dsonar.projectKey=ndf-gitea + -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info + + deploy: + needs: test-and-quality # On ne déploie QUE si les tests et Sonar sont OK + runs-on: ubuntu-latest + steps: + - name: Déploiement sur Portainer + run: | + echo "Ici on lance le script curl pour mettre à jour ta stack Portainer" + # On utilisera ton script node ou curl ici \ No newline at end of file