Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#3813Sonarcloud onboarding #2087

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
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
PRINCESANCHEZ marked this conversation as resolved.
Show resolved Hide resolved
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)
PRINCESANCHEZ marked this conversation as resolved.
Show resolved Hide resolved

[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