Skip to content

Commit c285693

Browse files
Merge pull request #2273 from OneCommunityGlobal/sundar/sonar-fix
Sundar: 🔥 Add SonarCloud CI-based analysis
2 parents 7d77c22 + 716ba78 commit c285693

2 files changed

Lines changed: 33 additions & 1 deletion

File tree

.github/workflows/node.js.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,29 @@ jobs:
7878
uses: actions/upload-artifact@v4
7979
with:
8080
name: backend-coverage-report
81-
path: coverage/
81+
path: coverage/
82+
83+
sonar:
84+
name: SonarCloud Scan
85+
runs-on: ubuntu-latest
86+
needs: test
87+
88+
steps:
89+
- name: Checkout code
90+
uses: actions/checkout@v4
91+
with:
92+
fetch-depth: 0
93+
94+
- name: Use Node.js 20.17.0
95+
uses: actions/setup-node@v4
96+
with:
97+
node-version: 20.17.0
98+
cache: 'npm'
99+
100+
- name: Install dependencies
101+
run: npm ci
102+
103+
- name: SonarCloud Scan
104+
uses: SonarSource/sonarqube-scan-action@v4
105+
env:
106+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

sonar-project.properties

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
sonar.projectKey=OneCommunityGlobal_HGNRest
2+
sonar.organization=onecommunityglobal
3+
4+
sonar.sources=src
5+
sonar.exclusions=**/node_modules/**,**/coverage/**,**/dist/**,**/build/**,**/*.test.js,**/*.spec.js,**/test/**,**/__tests__/**
6+
7+
sonar.javascript.lcov.reportPaths=coverage/lcov.info

0 commit comments

Comments
 (0)