Skip to content

Commit

Permalink
add sonarcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyMBridges committed Oct 25, 2024
1 parent 393a09c commit 79a5047
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ jobs:
SENTRY_KEY: ${{ secrets.SENTRY_KEY }}
GF_SURVEY_KEY: ${{ secrets.GF_SURVEY_KEY }}

sonarcloud:
name: Sonarcloud
uses: ./.github/workflows/sonarcloud.yml
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

all-jobs-completed:
name: All jobs completed
runs-on: ubuntu-latest
Expand All @@ -54,6 +60,7 @@ jobs:
- build
- lint
- case
- sonarcloud
outputs:
PASSED: ${{ steps.set-output.outputs.PASSED }}
steps:
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Sonarcloud

on:
workflow_call:
secrets:
SONAR_TOKEN:
required: true

jobs:
sonarcloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@5875562561d22a34be0c657405578705a169af6c
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 15 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Unique sonar data by project
sonar.projectKey=metamask-docs
sonar.organization=metamask

# Source
sonar.sources=src
# sonar.exclusions=

# Tests
# sonar.tests=src,test
# sonar.test.inclusions=**/*.test.ts
# sonar.javascript.lcov.reportPaths=coverage/coverage/unit/lcov.info

# Block PRs with quality gate failures
sonar.qualitygate.wait=false

0 comments on commit 79a5047

Please sign in to comment.