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

ci: add SonarCloud scan job #25421

Merged
merged 3 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 6 additions & 16 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
name: Sonar
on:
workflow_call:
secrets:
SONAR_TOKEN:
required: true
# pull_request:
# branches:
# - develop
# types:
# - opened
# - reopened
# - synchronize
# - labeled
# - unlabeled
push:
branches:
- develop
pull_request:
branches:
- develop
jvbriones marked this conversation as resolved.
Show resolved Hide resolved

jobs:
sonarcloud:
Expand All @@ -25,8 +18,5 @@ jobs:
- name: SonarCloud Scan
# This is SonarSource/sonarcloud-github-action@v2.0.0
uses: SonarSource/sonarcloud-github-action@4b4d7634dab97dcee0b75763a54a6dc92a9e6bc1
with:
args: >
-Dsonar.javascript.lcov.reportPaths=tests/coverage/lcov.info
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
26 changes: 11 additions & 15 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
sonar.projectKey=metamask-extension
sonar.organization=consensys
sonar.projectKey=metamask-extension-private
jvbriones marked this conversation as resolved.
Show resolved Hide resolved
sonar.organization=metamask
jvbriones marked this conversation as resolved.
Show resolved Hide resolved

# This is the name and version displayed in the SonarCloud UI.
sonar.projectName=MetaMask Extension
#sonar.projectVersion=1.0
# Source
jvbriones marked this conversation as resolved.
Show resolved Hide resolved
sonar.sources=app,development,offscreen,shared,types,ui
sonar.exclusions=**/*.test.**,**/*.spec.**,app/images

# Root for sonar analysis.
sonar.sources=app/
# Tests
sonar.tests=app,test,development,offscreen,shared,types,ui
sonar.test.inclusions=**/*.test.**,**/*.spec.**
sonar.javascript.lcov.reportPaths=tests/coverage/lcov.info

# Excluded project files from analysis.
#sonar.exclusions=

# Inclusions for test files.
sonar.test.inclusions=**.test.**

# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8
# Fail CI job if quality gate failures
sonar.qualitygate.wait=false
jvbriones marked this conversation as resolved.
Show resolved Hide resolved