Actualiser .gitea/workflows/ci.yml
This commit is contained in:
@@ -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
|
||||||
Reference in New Issue
Block a user