From 2400b6f05e2f974212d0ff3e6695e666cf06c7db Mon Sep 17 00:00:00 2001 From: ineszang44 Date: Fri, 18 Sep 2026 10:21:56 +0200 Subject: [PATCH] test: sonarqube --- .github/workflows/frontend.yml | 24 ++++++++++++++---------- sonar-project.properties | 2 +- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 586974a..6bcb72c 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -41,24 +41,28 @@ jobs: cache-dependency-path: apps/frontend/package-lock.json - run: npm ci working-directory: apps/frontend - - run: npm test --watch=false --code-coverage --coverageReporters=lcov + - run: npm test -- --watch=false --code-coverage --coverageReporters=lcov working-directory: apps/frontend + - name: Upload coverage + uses: actions/upload-artifact@v4 + with: + name: frontend-coverage + path: apps/frontend/coverage/frontend/lcov.info sonarqube: needs: [build, test] name: SonarQube runs-on: ubuntu-latest steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/checkout@v6 with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + fetch-depth: 0 + - name: Download coverage + uses: actions/download-artifact@v4 + with: + name: frontend-coverage + path: apps/frontend/coverage/frontend - name: SonarQube Scan - uses: SonarSource/sonarqube-scan-action@7006c4492b2e0ee0f816d36501671557c97f5995 # v8.1.0 + uses: SonarSource/sonarqube-scan-action@v8 env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - - - # deploy: - # runs-on: ubuntu-latest - # steps: - # - run: echo "DEPLOY job is running" diff --git a/sonar-project.properties b/sonar-project.properties index a2ce41a..7155d42 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -6,4 +6,4 @@ sonar.sources=apps/frontend/src,apps/backend/app sonar.exclusions=**/node_modules/**,**/dist/**,**/*.spec.js,**/*.test.js,github,db,ml,docker-compose.yml,**/**/Dockerfile,**/**/proxy.conf.json,**/**/package.json,**/**/angular.json -sonar.javascript.lcov.reportPaths=/home/runner/work/ProjetPiscine_EnerVision/ProjetPiscine_EnerVision/apps/frontend/coverage/frontend/lcov.info +sonar.javascript.lcov.reportPaths=apps/frontend/coverage/frontend/lcov.info