diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 21036cb6e..f1e2012aa 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -70,5 +70,13 @@ jobs: - name: Run jest run: npx jest --coverage --group=unit + - name: SonarCloud scan + if: ${{ github.repository == 'jellyfin/jellyfin-sdk-typescript' }} + uses: SonarSource/sonarcloud-github-action@c25d2e7e3def96d0d1781000d3c429da22cd6252 # v2.0.2 + env: + GITHUB_TOKEN: ${{ secrets.JF_BOT_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + - name: Upload coverage + if: ${{ github.repository == 'jellyfin/jellyfin-sdk-typescript' }} uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 diff --git a/.npmignore b/.npmignore index ce0a6b844..4a09377e4 100644 --- a/.npmignore +++ b/.npmignore @@ -21,5 +21,6 @@ openapi-templates codecov.yml jest.config.cjs rollup.config.js +sonar-project.properties .sonarcloud.properties tsconfig.json diff --git a/.sonarcloud.properties b/sonar-project.properties similarity index 57% rename from .sonarcloud.properties rename to sonar-project.properties index bdc73bd6d..b29c36efb 100644 --- a/.sonarcloud.properties +++ b/sonar-project.properties @@ -1,3 +1,6 @@ +sonar.projectKey=jellyfin_jellyfin-sdk-typescript +sonar.organization=jellyfin + # Paths for sources sonar.sources = src/ sonar.exclusions = src/**/__tests__/**/*,src/**/__helpers__/**/*,src/generated-client/**/* @@ -5,3 +8,6 @@ sonar.exclusions = src/**/__tests__/**/*,src/**/__helpers__/**/*,src/generated-c # Paths for tests sonar.tests = src/ sonar.test.inclusions = src/**/__tests__/**/* + +# Coverage report paths +sonar.javascript.lcov.reportPaths = coverage/lcov.info