From 700471c8e96a5f04ebe4a64f47a0aab82acd361e Mon Sep 17 00:00:00 2001 From: abdullahmujahidali Date: Tue, 23 Dec 2025 20:39:10 +0500 Subject: [PATCH 1/2] feat: add SonarCloud CI-based analysis --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++++++ sonar-project.properties | 23 +++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 sonar-project.properties diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f150fd..584769a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,6 +46,33 @@ jobs: files: ./coverage/coverage-final.json fail_ci_if_error: false + sonarcloud: + name: SonarCloud Analysis + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Shallow clones should be disabled for better analysis + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run tests with coverage + run: npm run test:coverage + + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + build: name: Build runs-on: ubuntu-latest diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..e25356f --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,23 @@ +sonar.projectKey=abdullahmujahidali_Cellify +sonar.organization=abdullahmujahidali + +# Project information +sonar.projectName=Cellify +sonar.projectVersion=0.3.0 + +# Source code location +sonar.sources=src +sonar.tests=tests + +# Exclusions +sonar.exclusions=**/node_modules/**,**/dist/**,**/coverage/**,**/wasm/**,**/*.test.ts,**/*.spec.ts + +# Test exclusions from coverage +sonar.test.inclusions=**/*.test.ts,**/*.spec.ts + +# TypeScript/JavaScript settings +sonar.javascript.lcov.reportPaths=coverage/lcov.info +sonar.typescript.lcov.reportPaths=coverage/lcov.info + +# Encoding +sonar.sourceEncoding=UTF-8 From 4275e8632ae1ba83842a5d7354bd602f22da7d9b Mon Sep 17 00:00:00 2001 From: abdullahmujahidali Date: Wed, 24 Dec 2025 05:17:17 +0500 Subject: [PATCH 2/2] updated ci sonar --- .github/workflows/ci.yml | 2 +- sonar-project.properties | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 584769a..989e52e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,7 +68,7 @@ jobs: run: npm run test:coverage - name: SonarCloud Scan - uses: SonarSource/sonarcloud-github-action@master + uses: SonarSource/sonarqube-scan-action@v5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/sonar-project.properties b/sonar-project.properties index e25356f..3c0d0d9 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,5 +1,6 @@ sonar.projectKey=abdullahmujahidali_Cellify sonar.organization=abdullahmujahidali +sonar.host.url=https://sonarcloud.io # Project information sonar.projectName=Cellify