From 8e07168a5e4208dded74fdb8cd5052708aafe6ce Mon Sep 17 00:00:00 2001 From: ineszang44 Date: Thu, 17 Sep 2026 12:19:26 +0200 Subject: [PATCH 01/21] =?UTF-8?q?test:=20ajout=20de=20propri=C3=A9t=C3=A9s?= =?UTF-8?q?=20dans=20le=20fichier=20de=20config=20pour=20sonarqube?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sonar-project.properties | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 3c1af86..c2cab78 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,14 +1,13 @@ sonar.projectKey=ProjetPiscine_EnerVision sonar.organization=groupe3-ener-vision - - -# This is the name and version displayed in the SonarCloud UI. -#sonar.projectName=ProjetPiscine_EnerVision -#sonar.projectVersion=1.0 - +sonar.sourceEncoding=UTF-8 # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. -#sonar.sources=. +sonar.sources=frontend/src,backend/src +# Répertoire contenant les TU +sonar.tests=frontend/tests,backend/tests,frontend/tests/**,backend/tests/** + +sonar.javascript.lcov.reportPaths=frontend/coverage/lcov.info,backend/coverage/lcov.info # Encoding of the source code. Default is default system encoding #sonar.sourceEncoding=UTF-8 \ No newline at end of file From 34f35f3ca015cd95b21edc46ed36c856ea02a13c Mon Sep 17 00:00:00 2001 From: ineszang44 Date: Thu, 17 Sep 2026 12:26:04 +0200 Subject: [PATCH 02/21] test: sonarqube --- .github/workflows/frontend.yml | 13 ------------- sonar-project.properties | 6 +++--- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 98d5d53..2259958 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -2,19 +2,6 @@ name: Frontend # Pipeline à choix multiple on: - # workflow_dispatch -> lancement manuel des jobs - workflow_dispatch: - inputs: - job_choice: - required: true - description: "Choix du job" - type: choice - default: all - options: - - build - - sonarqube - - test - - all # lancer tous les jobs push: paths: - "apps/frontend/**" diff --git a/sonar-project.properties b/sonar-project.properties index c2cab78..60f4e30 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,11 +3,11 @@ sonar.organization=groupe3-ener-vision sonar.sourceEncoding=UTF-8 # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. -sonar.sources=frontend/src,backend/src +sonar.sources=apps/frontend/src,apps/backend/src # Répertoire contenant les TU -sonar.tests=frontend/tests,backend/tests,frontend/tests/**,backend/tests/** +sonar.tests=apps/frontend/tests,apps/backend/tests,apps/frontend/tests/**,apps/backend/tests/** -sonar.javascript.lcov.reportPaths=frontend/coverage/lcov.info,backend/coverage/lcov.info +sonar.javascript.lcov.reportPaths=apps/frontend/coverage/lcov.info,apps/backend/coverage/lcov.info # Encoding of the source code. Default is default system encoding #sonar.sourceEncoding=UTF-8 \ No newline at end of file From 00ef725249cdd52a9e53f20a5b889a6205928dc7 Mon Sep 17 00:00:00 2001 From: ineszang44 Date: Thu, 17 Sep 2026 12:46:04 +0200 Subject: [PATCH 03/21] test: sonarqube --- .github/workflows/frontend.yml | 7 ++++++- sonar-project.properties | 7 ++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 2259958..ff28d1a 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -41,8 +41,13 @@ jobs: cache-dependency-path: apps/frontend/package-lock.json - run: npm ci working-directory: apps/frontend - - run: npm test -- --watch=false + - run: npm test --watch=false --code-coverage --coverageReporters=lcov working-directory: apps/frontend + - name: Download frontend coverage + uses: actions/download-artifact@v4 + with: + name: frontend-coverage + path: apps/frontend/coverage sonarqube: needs: [build, test] diff --git a/sonar-project.properties b/sonar-project.properties index 60f4e30..b32eaf5 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -8,6 +8,7 @@ sonar.sources=apps/frontend/src,apps/backend/src # Répertoire contenant les TU sonar.tests=apps/frontend/tests,apps/backend/tests,apps/frontend/tests/**,apps/backend/tests/** -sonar.javascript.lcov.reportPaths=apps/frontend/coverage/lcov.info,apps/backend/coverage/lcov.info -# Encoding of the source code. Default is default system encoding -#sonar.sourceEncoding=UTF-8 \ No newline at end of file +sonar.test.inclusions=**/*.spec.ts,**/*.test.ts,**/*.spec.js,**/*.test.js +sonar.exclusions=**/node_modules/**,**/dist/**,**/coverage/** + +sonar.junit.reportPaths=apps/frontend/tests/test-results From 41c18a3bb12b261988b30b8670f1483afc3890f8 Mon Sep 17 00:00:00 2001 From: ineszang44 Date: Thu, 17 Sep 2026 12:47:44 +0200 Subject: [PATCH 04/21] test: sonarqube --- .github/workflows/frontend.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index ff28d1a..b8c0096 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -43,12 +43,6 @@ jobs: working-directory: apps/frontend - run: npm test --watch=false --code-coverage --coverageReporters=lcov working-directory: apps/frontend - - name: Download frontend coverage - uses: actions/download-artifact@v4 - with: - name: frontend-coverage - path: apps/frontend/coverage - sonarqube: needs: [build, test] name: SonarQube From 11f9b1bcd5c94a7dae83d0126b77bec7f8ee7383 Mon Sep 17 00:00:00 2001 From: ineszang44 Date: Thu, 17 Sep 2026 13:04:36 +0200 Subject: [PATCH 05/21] test(frontend): sonarqube --- .github/workflows/frontend.yml | 1 + sonar-project.properties | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index b8c0096..586974a 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -43,6 +43,7 @@ jobs: working-directory: apps/frontend - run: npm test --watch=false --code-coverage --coverageReporters=lcov working-directory: apps/frontend + sonarqube: needs: [build, test] name: SonarQube diff --git a/sonar-project.properties b/sonar-project.properties index b32eaf5..100dfd5 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,10 +3,10 @@ sonar.organization=groupe3-ener-vision sonar.sourceEncoding=UTF-8 # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. -sonar.sources=apps/frontend/src,apps/backend/src +sonar.sources=apps/frontend/src # Répertoire contenant les TU -sonar.tests=apps/frontend/tests,apps/backend/tests,apps/frontend/tests/**,apps/backend/tests/** +sonar.tests=apps/frontend/src sonar.test.inclusions=**/*.spec.ts,**/*.test.ts,**/*.spec.js,**/*.test.js sonar.exclusions=**/node_modules/**,**/dist/**,**/coverage/** From ff68a51424a2f2a115ffccc025a5d421cadb4b05 Mon Sep 17 00:00:00 2001 From: ineszang44 Date: Thu, 17 Sep 2026 13:36:21 +0200 Subject: [PATCH 06/21] feat(frontend): fichier de config pour vitest --- apps/frontend/vitest.config.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 apps/frontend/vitest.config.ts diff --git a/apps/frontend/vitest.config.ts b/apps/frontend/vitest.config.ts new file mode 100644 index 0000000..e6ea512 --- /dev/null +++ b/apps/frontend/vitest.config.ts @@ -0,0 +1,18 @@ +import { defineConfig } from 'vitest/config' + +export default defineConfig({ + test: { + coverage: { + provider: 'v8', + reporter: ['text', 'lcov'], + reportsDirectory: './coverage', + include: ['src/**/*.{ts,tsx,js,jsx}'], + exclude: [ + '**/*.spec.*', + '**/*.test.*', + '**/node_modules/**', + '**/dist/**', + ], + }, + }, +}) \ No newline at end of file From ed7311d4efde47bb275e7463da9d208706734883 Mon Sep 17 00:00:00 2001 From: ineszang44 Date: Thu, 17 Sep 2026 13:36:41 +0200 Subject: [PATCH 07/21] test: configuration sonarqube --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 100dfd5..18de3f3 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -11,4 +11,4 @@ sonar.tests=apps/frontend/src sonar.test.inclusions=**/*.spec.ts,**/*.test.ts,**/*.spec.js,**/*.test.js sonar.exclusions=**/node_modules/**,**/dist/**,**/coverage/** -sonar.junit.reportPaths=apps/frontend/tests/test-results +sonar.javascript.lcov.reportPaths=apps/frontend/coverage/lcov.info From 278299c2b1535677a568ec385affce2416040576 Mon Sep 17 00:00:00 2001 From: ineszang44 Date: Thu, 17 Sep 2026 14:18:54 +0200 Subject: [PATCH 08/21] test: configuration sonarqube + config angular --- apps/frontend/angular.json | 9 --------- 1 file changed, 9 deletions(-) diff --git a/apps/frontend/angular.json b/apps/frontend/angular.json index 6cb33fa..981779f 100644 --- a/apps/frontend/angular.json +++ b/apps/frontend/angular.json @@ -86,15 +86,6 @@ "text-summary", "lcov", "html" - ], - "reporters": [ - "default", - [ - "junit", - { - "outputFile": "test-results/junit.xml" - } - ] ] } } From 2465021d61e01ade4339f6d9e2dd514f4c182748 Mon Sep 17 00:00:00 2001 From: ineszang44 Date: Thu, 17 Sep 2026 14:22:30 +0200 Subject: [PATCH 09/21] fix(frontend): chemin vers lcov.info --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 18de3f3..ee530ac 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -11,4 +11,4 @@ sonar.tests=apps/frontend/src sonar.test.inclusions=**/*.spec.ts,**/*.test.ts,**/*.spec.js,**/*.test.js sonar.exclusions=**/node_modules/**,**/dist/**,**/coverage/** -sonar.javascript.lcov.reportPaths=apps/frontend/coverage/lcov.info +sonar.javascript.lcov.reportPaths=apps/frontend/coverage//frontend/lcov.info From 334ca5982b781d929142d961b11fe5a95eae4c8a Mon Sep 17 00:00:00 2001 From: ineszang44 Date: Thu, 17 Sep 2026 14:26:22 +0200 Subject: [PATCH 10/21] fix(frontend): chemin vers lcov.info --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index ee530ac..adf2309 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -11,4 +11,4 @@ sonar.tests=apps/frontend/src sonar.test.inclusions=**/*.spec.ts,**/*.test.ts,**/*.spec.js,**/*.test.js sonar.exclusions=**/node_modules/**,**/dist/**,**/coverage/** -sonar.javascript.lcov.reportPaths=apps/frontend/coverage//frontend/lcov.info +sonar.javascript.lcov.reportPaths=apps/frontend/coverage/frontend/lcov.info From 4ee210962862b83a334c73b871d1ce5b64945ff8 Mon Sep 17 00:00:00 2001 From: ineszang44 Date: Thu, 17 Sep 2026 14:32:14 +0200 Subject: [PATCH 11/21] =?UTF-8?q?fix(frontend):=20prise=20en=20compte=20du?= =?UTF-8?q?=20r=C3=A9pertoire=20du=20reporter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index adf2309..9ffcb8f 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,7 +3,7 @@ sonar.organization=groupe3-ener-vision sonar.sourceEncoding=UTF-8 # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. -sonar.sources=apps/frontend/src +sonar.sources=apps/frontend/src,apps/frontend/coverage # Répertoire contenant les TU sonar.tests=apps/frontend/src From 7bc9a09489d1bfdc7eba6fb96105700d99646542 Mon Sep 17 00:00:00 2001 From: ineszang44 Date: Thu, 17 Sep 2026 14:38:08 +0200 Subject: [PATCH 12/21] =?UTF-8?q?fix(frontend):=20mise=20=C3=A0=20jour=20d?= =?UTF-8?q?es=20propri=C3=A9t=C3=A9s=20sonar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 9ffcb8f..78c8162 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,12 +3,12 @@ sonar.organization=groupe3-ener-vision sonar.sourceEncoding=UTF-8 # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. -sonar.sources=apps/frontend/src,apps/frontend/coverage +sonar.sources=apps/frontend/src,apps/frontend/** # Répertoire contenant les TU sonar.tests=apps/frontend/src sonar.test.inclusions=**/*.spec.ts,**/*.test.ts,**/*.spec.js,**/*.test.js -sonar.exclusions=**/node_modules/**,**/dist/**,**/coverage/** +sonar.exclusions=**/node_modules/**,**/dist/** sonar.javascript.lcov.reportPaths=apps/frontend/coverage/frontend/lcov.info From 1afaee069f47681a9d9d0c8c0af8a6567c404854 Mon Sep 17 00:00:00 2001 From: ineszang44 Date: Thu, 17 Sep 2026 14:39:48 +0200 Subject: [PATCH 13/21] =?UTF-8?q?fix(frontend):=20mise=20=C3=A0=20jour=20d?= =?UTF-8?q?es=20propri=C3=A9t=C3=A9s=20sonar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 78c8162..fd1dece 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,7 +3,7 @@ sonar.organization=groupe3-ener-vision sonar.sourceEncoding=UTF-8 # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. -sonar.sources=apps/frontend/src,apps/frontend/** +sonar.sources=apps/frontend/src,apps/frontend # Répertoire contenant les TU sonar.tests=apps/frontend/src From 1fce577a789229db4be29e27e8c6f00179e03114 Mon Sep 17 00:00:00 2001 From: ineszang44 Date: Thu, 17 Sep 2026 14:45:54 +0200 Subject: [PATCH 14/21] =?UTF-8?q?fix(frontend):=20mise=20=C3=A0=20jour=20d?= =?UTF-8?q?es=20propri=C3=A9t=C3=A9s=20sonar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sonar-project.properties | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index fd1dece..2a9adfd 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -2,13 +2,10 @@ sonar.projectKey=ProjetPiscine_EnerVision sonar.organization=groupe3-ener-vision sonar.sourceEncoding=UTF-8 -# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. -sonar.sources=apps/frontend/src,apps/frontend - -# Répertoire contenant les TU +sonar.sources=apps/frontend/src sonar.tests=apps/frontend/src sonar.test.inclusions=**/*.spec.ts,**/*.test.ts,**/*.spec.js,**/*.test.js -sonar.exclusions=**/node_modules/**,**/dist/** +sonar.exclusions=**/node_modules/**,**/dist/**,**/*.spec.ts,**/*.test.ts,**/*.spec.js,**/*.test.js sonar.javascript.lcov.reportPaths=apps/frontend/coverage/frontend/lcov.info From 19cfac1cffd58e7d259789ab87e3397c42759789 Mon Sep 17 00:00:00 2001 From: ineszang44 Date: Thu, 17 Sep 2026 14:48:52 +0200 Subject: [PATCH 15/21] =?UTF-8?q?fix(frontend):=20mise=20=C3=A0=20jour=20d?= =?UTF-8?q?es=20propri=C3=A9t=C3=A9s=20sonar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 2a9adfd..0be1a3d 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -2,7 +2,7 @@ sonar.projectKey=ProjetPiscine_EnerVision sonar.organization=groupe3-ener-vision sonar.sourceEncoding=UTF-8 -sonar.sources=apps/frontend/src +sonar.sources=apps/frontend/src,apps/frontend sonar.tests=apps/frontend/src sonar.test.inclusions=**/*.spec.ts,**/*.test.ts,**/*.spec.js,**/*.test.js From 5875e8c23936674de9010125d88375170ab8e007 Mon Sep 17 00:00:00 2001 From: ineszang44 Date: Fri, 18 Sep 2026 10:01:28 +0200 Subject: [PATCH 16/21] test: sonarqube --- sonar-project.properties | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 0be1a3d..17c5a87 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -2,10 +2,8 @@ sonar.projectKey=ProjetPiscine_EnerVision sonar.organization=groupe3-ener-vision sonar.sourceEncoding=UTF-8 -sonar.sources=apps/frontend/src,apps/frontend -sonar.tests=apps/frontend/src +sonar.sources=apps/frontend/src,apps/backend/app -sonar.test.inclusions=**/*.spec.ts,**/*.test.ts,**/*.spec.js,**/*.test.js -sonar.exclusions=**/node_modules/**,**/dist/**,**/*.spec.ts,**/*.test.ts,**/*.spec.js,**/*.test.js +sonar.exclusions=**/node_modules/**,**/dist/**,**/*.spec.js,**/*.test.js sonar.javascript.lcov.reportPaths=apps/frontend/coverage/frontend/lcov.info From c1f63889c1f09f36808ce711dc8cba07ef264e79 Mon Sep 17 00:00:00 2001 From: ineszang44 Date: Fri, 18 Sep 2026 10:10:05 +0200 Subject: [PATCH 17/21] test: sonarqube --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 17c5a87..87c63d2 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -4,6 +4,6 @@ sonar.sourceEncoding=UTF-8 sonar.sources=apps/frontend/src,apps/backend/app -sonar.exclusions=**/node_modules/**,**/dist/**,**/*.spec.js,**/*.test.js +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=apps/frontend/coverage/frontend/lcov.info +sonar.javascript.lcov.reportPaths=apps/frontend/coverage/frontend From 6cb9ac00cb7e8fac7c372440beca9353eeeb0ddf Mon Sep 17 00:00:00 2001 From: ineszang44 Date: Fri, 18 Sep 2026 10:14:06 +0200 Subject: [PATCH 18/21] test: sonarqube --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 87c63d2..2e73864 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=apps/frontend/coverage/frontend +sonar.javascript.lcov.reportPaths=/home/runner/work/ProjetPiscine_EnerVision/ProjetPiscine_EnerVision/apps/frontend/coverage/frontend From 9e33c276d65c2b527814abe088d586e15284bd20 Mon Sep 17 00:00:00 2001 From: ineszang44 Date: Fri, 18 Sep 2026 10:16:31 +0200 Subject: [PATCH 19/21] test: sonarqube --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 2e73864..a2ce41a 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 +sonar.javascript.lcov.reportPaths=/home/runner/work/ProjetPiscine_EnerVision/ProjetPiscine_EnerVision/apps/frontend/coverage/frontend/lcov.info From 2400b6f05e2f974212d0ff3e6695e666cf06c7db Mon Sep 17 00:00:00 2001 From: ineszang44 Date: Fri, 18 Sep 2026 10:21:56 +0200 Subject: [PATCH 20/21] 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 From cc0a58ac4cdb20a8d8732ec39ead2554de3a7a1b Mon Sep 17 00:00:00 2001 From: ineszang44 Date: Fri, 18 Sep 2026 10:23:09 +0200 Subject: [PATCH 21/21] test: sonarqube --- .github/workflows/frontend.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 6bcb72c..aff8d71 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -41,7 +41,7 @@ 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