Files
NDF/.gitea/workflows/ci.yml
T
msaid-soighiri 9cee6f1ed1
CI-CD NDF Complet / test-and-quality (push) Has been cancelled
CI-CD NDF Complet / deploy (push) Has been cancelled
Actualiser .gitea/workflows/ci.yml
2026-05-07 16:56:56 +02:00

42 lines
1.2 KiB
YAML

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