From ac162f6164b335b82d8da2d097698e8ff1c0d01d Mon Sep 17 00:00:00 2001 From: Javier Briones <1674192+jvbriones@users.noreply.github.com> Date: Wed, 19 Jun 2024 16:10:20 +0200 Subject: [PATCH 1/2] chore: add SonarCloud scan --- .github/workflows/sonar.yml | 19 +++---------------- sonar-project.properties | 26 +++++++++++--------------- 2 files changed, 14 insertions(+), 31 deletions(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 61d549728d99..f42f8b336b9d 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -1,18 +1,8 @@ name: Sonar on: - workflow_call: - secrets: - SONAR_TOKEN: - required: true -# pull_request: -# branches: -# - develop -# types: -# - opened -# - reopened -# - synchronize -# - labeled -# - unlabeled + pull_request: + branches: + - develop jobs: sonarcloud: @@ -25,8 +15,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 }} diff --git a/sonar-project.properties b/sonar-project.properties index de14094b965e..0455fa9634e2 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,18 +1,14 @@ -sonar.projectKey=metamask-extension -sonar.organization=consensys +sonar.projectKey=metamask-extension-private +sonar.organization=metamask -# This is the name and version displayed in the SonarCloud UI. -sonar.projectName=MetaMask Extension -#sonar.projectVersion=1.0 +# Source +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 \ No newline at end of file From 9a90e1458e38684e5ac935bca5805670201cf1ad Mon Sep 17 00:00:00 2001 From: Javier Briones <1674192+jvbriones@users.noreply.github.com> Date: Fri, 28 Jun 2024 04:10:42 +0200 Subject: [PATCH 2/2] chore: add SonarCloud scan --- .github/workflows/sonar.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index f42f8b336b9d..f5e1a0552dd1 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -1,5 +1,8 @@ name: Sonar on: + push: + branches: + - develop pull_request: branches: - develop