Skip to content
16 changes: 16 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,22 @@ jobs:
- run: ./canvas_modules/harness/build.sh test
- run: ./canvas_modules/harness/functional_test.sh

sonarcloud:
if: github.ref == 'refs/heads/main'
if: github.repository == 'elyra-ai/canvas'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
node-version: 20.x
- name: Install common-canvas dependencies
run: npm install --prefix canvas_modules/common-canvas
- 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
needs: [build]
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=your-project-key&metric=alert_status)](https://sonarcloud.io/dashboard?id=your-project-key)

[View SonarCloud Results](https://sonarcloud.io/dashboard?id=your-project-key)

## Using local version of common-canvas and/or common-properties
Clone elyra/canvas
```sh
Expand Down
8 changes: 8 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -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