diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4dc84eb703..b83063e741 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,6 +39,12 @@ jobs: - run: ./canvas_modules/common-canvas/build.sh - run: ./canvas_modules/harness/build.sh test - run: ./canvas_modules/harness/functional_test.sh + if: github.ref == 'refs/heads/main' + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@v1 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + GIT_TOKEN: ${{ secrets.GIT_TOKEN }} tag: runs-on: ubuntu-latest diff --git a/README.md b/README.md index c39cabc255..a6e8341c08 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,13 @@ See [here](https://github.com/elyra-ai/canvas/tree/main/canvas_modules/harness) * Elyra canvas documentation - https://elyra-ai.github.io/canvas/ * Elyra canvas playground (Test harness) - https://ibm.biz/elyra-canvas-test-harness +## Quality and Coverage +We use SonarCloud to ensure code quality and maintain high test coverage. You can view the detailed analysis and results by following the link below: + +[![SonarCloud](https://sonarcloud.io/api/project_badges/measure?project=elyra-ai_canvas&metric=alert_status)](https://sonarcloud.io/dashboard?id=elyra-ai_canvas) + +[View SonarCloud Results](https://sonarcloud.io/dashboard?id=elyra-ai_canvas) + ## Using local version of common-canvas and/or common-properties Clone elyra/canvas ```sh diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000000..955b00c7fa --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,8 @@ +sonar.projectKey=elyra-ai_canvas + +# relative paths to source directories. More details and properties are described +# in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/ +sonar.sources=canvas_modules/common-canvas/src +sonar.tests=canvas_modules/common-canvas/__tests__ +sonar.javascript.lcov.reportPaths=canvas_modules/common-canvas/coverage/lcov.info +sonar.verbose=true