From ab91170347d151b086cfb8d206b2727a3f3489ab Mon Sep 17 00:00:00 2001 From: louis Date: Fri, 26 Apr 2024 21:49:02 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Configure=20SonarCloud?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/integration.yml | 9 +++++---- README.md | 4 +++- sonar-project.properties | 9 +++++++++ vite.config.ts | 4 ++++ 4 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 sonar-project.properties diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index a577b2ff..7b988111 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -26,10 +26,11 @@ jobs: - name: Test run: yarn run coverage - - name: Codecov - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} + - name: SonarCloud Scan + uses: sonarsource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} build: name: Build diff --git a/README.md b/README.md index f3159018..430f1c0d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# ticker-admin [![Integration](https://github.com/systemli/ticker-admin/actions/workflows/integration.yml/badge.svg)](https://github.com/systemli/ticker-admin/actions/workflows/integration.yml) +# ticker-admin + +[![Integration](https://github.com/systemli/ticker-admin/actions/workflows/integration.yml/badge.svg)](https://github.com/systemli/ticker-admin/actions/workflows/integration.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=systemli_ticker-admin&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=systemli_ticker-admin) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=systemli_ticker-admin&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=systemli_ticker-admin) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=systemli_ticker-admin&metric=coverage)](https://sonarcloud.io/summary/new_code?id=systemli_ticker-admin) ## Development diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 00000000..6045ca37 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,9 @@ +sonar.projectKey=systemli_ticker-admin +sonar.organization=systemli + +sonar.sources=src/ +sonar.exclusions=src/__mocks__/** + +sonar.test.inclusions=**/*.test.tsx,**/*.test.ts + +sonar.javascript.lcov.reportPaths=coverage/lcov.info diff --git a/vite.config.ts b/vite.config.ts index c367e33c..be37746e 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -16,5 +16,9 @@ export default defineConfig({ environment: 'jsdom', setupFiles: './vitest-setup.ts', css: false, + coverage: { + provider: 'v8', + reporter: ['lcov'], + }, }, })