From a93a2c10ae4b57733fe36bf584d99f99904befaa Mon Sep 17 00:00:00 2001 From: Simon Demaziere Date: Fri, 8 Dec 2023 10:09:43 +0100 Subject: [PATCH] ci: fix sonar conf for coverage --- .github/workflows/build-and-test.yml | 3 +++ package.json | 2 +- sonar-project.properties | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 54078f4..ed01b32 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -16,6 +16,9 @@ jobs: run: yarn --frozen-lockfile - name: test & coverage run: yarn run test + - name: fix code coverage paths + working-directory: ./coverage + run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' lcov.info - name: SonarCloud scan uses: SonarSource/sonarcloud-github-action@master env: diff --git a/package.json b/package.json index 79189da..3562606 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sonor", - "version": "0.5.21", + "version": "0.5.22", "private": true, "dependencies": { "@testing-library/jest-dom": "^4.2.4", diff --git a/sonar-project.properties b/sonar-project.properties index b8b1232..8187f9c 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,6 +3,6 @@ sonar.projectKey=InseeFr_Sonor sonar.organization=inseefr # exclude tests files for code duplication evaluation -sonar.sources = src/ -sonar.exclusions = src/tests/**/*,src/components/**/__snapshots__/* +sonar.sources = src +sonar.exclusions = src/tests/**, src/components/**/__snapshots__/* , //src/tests/** sonar.javascript.lcov.reportPaths = coverage/lcov.info \ No newline at end of file