-
Notifications
You must be signed in to change notification settings - Fork 1
SC-85878 Set-up SonarQube #68
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
Open
ksza
wants to merge
20
commits into
master
Choose a base branch
from
sc-85878-sonarqube-for-opticks
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
e287284
Sonar setup
40af484
Fix sonar workflow
03a9dcb
Fix sonar workflow
273a261
Merge branch 'master' into sonar_setup
ksza 2ae7f67
Use default jest coverage tool
ksza d4b0ce1
Use artifact to store coverage results across jobs
ksza a43a7ce
Fix typo in sonar job
ksza 6487eea
Fix wrong attribute value in sonar job
ksza 899e3f0
Fix git ref variable
ksza 371adb5
Get tag using an action
ksza 5944085
Save more files in the artifact
ksza 16064d8
Also save clover.xml in the sonar artifact
ksza f939a65
Update report file path
ksza 91f84d7
Do not clean up the sonar artifact
ksza a0356d6
Test coverage files are there after artifact download
ksza 592afad
Remove test checks
ksza 93c3696
Fix coverage path
ksza 0e34e6f
Try reading latest tag
ksza aa530f4
Try github.ref_name for release tag
ksza 636e2a2
Fix sonar workflow
ksza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| name: sonar | ||
|
|
||
| on: | ||
| workflow_call: | ||
| secrets: | ||
| SONAR_HOST_URL: | ||
| description: "Sonar host" | ||
| required: true | ||
| SONAR_TOKEN: | ||
| description: "SonarQube token" | ||
| required: true | ||
|
|
||
| env: | ||
| LANG: "en_US.UTF-8" | ||
| LANGUAGE: "en_US:en" | ||
| LC_ALL: "en_US.UTF-8" | ||
|
|
||
| jobs: | ||
| sonarqube: | ||
| name: Sonar analysis | ||
| runs-on: ubuntu-latest | ||
| continue-on-error: true | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Download reporting artifacts for Sonar | ||
| uses: actions/download-artifact@v3 | ||
| with: | ||
| name: sonar-report-artifacts | ||
|
|
||
| - name: SonarQube Scan | ||
| uses: sonarsource/sonarqube-scan-action@master | ||
| with: | ||
| args: | ||
| -Dsonar.verbose=true | ||
| # TODO: pass in the latest release tag name | ||
| # -Dsonar.projectVersion=${{ xxx }} | ||
| env: | ||
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
| SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | ||
|
|
||
| - name: Remove reporting artifacts for Sonar | ||
| uses: geekyeggo/delete-artifact@v2 | ||
| with: | ||
| name: sonar-report-artifacts | ||
| failOnError: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,3 +12,7 @@ | |
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
|
|
||
| .scannerwork/ | ||
| coverage/ | ||
| test-report.xml | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Must be unique in a given SonarQube instance | ||
| sonar.projectKey=opticks | ||
|
|
||
| # This is the name and version displayed in the SonarQube UI. | ||
| sonar.projectName=Opticks - Toggle Library | ||
| sonar.projectVersion=1.0 | ||
|
|
||
| # Path is relative to the sonar-project.properties file. | ||
| sonar.sources=src | ||
| sonar.tests=src | ||
|
|
||
| # Encoding of the source code. Default is default system encoding | ||
| sonar.sourceEncoding=UTF-8 | ||
|
|
||
| sonar.exclusions=**/*.test.* | ||
| sonar.test.inclusions=**/*.test.tsx,**/*.test.ts | ||
|
|
||
| sonar.javascript.coveragePlugin=lcov | ||
|
|
||
| # Downloading the artifact does not recreate the directory structure | ||
| # so we must consume the lcov.info from the root | ||
| # Running locally? use coverage/lcov.info instead | ||
| sonar.javascript.lcov.reportPaths=lcov.info | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to exclude mocks as well to correctly reflect the code coverage.
Maybe smth like