diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml new file mode 100644 index 0000000..2211470 --- /dev/null +++ b/.github/workflows/sonarqube.yml @@ -0,0 +1,29 @@ +name: "CI | SocketClient Sonar" + +on: + push: + branches: [ main ] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + sonarqube: + name: "SocketClient - SonarQube Analysis" + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + - uses: SonarSource/sonarqube-scan-action@v7 + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository + env: + SONAR_TOKEN: ${{ secrets.NICE_SONAR_TOKEN }} + SONAR_HOST_URL: ${{ vars.NICE_SONAR_HOST_URL }} diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..3346be8 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,25 @@ +sonar.projectKey=com.nice.cognigy-boron-SocketClient +sonar.projectName=cognigy-boron-SocketClient + +sonar.sources=. +sonar.tests=. +sonar.sourceEncoding=UTF-8 + +sonar.exclusions=\ + **/node_modules/**,\ + **/dist/**,\ + **/build/**,\ + **/vendor/**,\ + **/coverage/**,\ + **/*.gen.go,\ + **/*.gen.ts + +sonar.test.inclusions=\ + **/*.test.ts,\ + **/*.spec.ts,\ + **/*_test.go,\ + **/__tests__/** + +# Coverage (enable once CI emits reports - see https://cognigy.atlassian.net/wiki/spaces/Engineering/pages/2559967260 #3): +# sonar.go.coverage.reportPaths=... +# sonar.javascript.lcov.reportPaths=...