9696 - name : Install dependencies
9797 run : npm ci --legacy-peer-deps
9898
99- - name : Run tests
100- run : npm test
99+ - name : Run tests with coverage
100+ run : npm run test:coverage
101+
102+ - name : Upload coverage report
103+ uses : actions/upload-artifact@v4
104+ with :
105+ name : coverage-report
106+ path : coverage/lcov.info
101107
102108 typescript-build :
103109 name : TypeScript Build
@@ -120,6 +126,29 @@ jobs:
120126 env :
121127 EXPO_NO_TELEMETRY : 1
122128
129+ sonarcloud :
130+ name : SonarCloud Analysis
131+ runs-on : ubuntu-latest
132+ needs : [typescript-tests]
133+ if : github.event_name == 'pull_request' || github.ref == 'refs/heads/main'
134+ steps :
135+ - name : Checkout code
136+ uses : actions/checkout@v4
137+ with :
138+ fetch-depth : 0
139+
140+ - name : Download coverage report
141+ uses : actions/download-artifact@v4
142+ with :
143+ name : coverage-report
144+ path : coverage
145+
146+ - name : SonarCloud Scan
147+ uses : SonarSource/sonarcloud-github-action@master
148+ env :
149+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
150+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
151+
123152 # ─────────────────────────────────────────────────────────
124153 # Rust / Soroban Smart Contract Checks
125154 # ─────────────────────────────────────────────────────────
@@ -217,6 +246,7 @@ jobs:
217246 typescript-typecheck,
218247 typescript-tests,
219248 typescript-build,
249+ sonarcloud,
220250 rust-format,
221251 rust-clippy,
222252 rust-tests,
@@ -240,6 +270,7 @@ jobs:
240270 typescript-typecheck,
241271 typescript-tests,
242272 typescript-build,
273+ sonarcloud,
243274 rust-format,
244275 rust-clippy,
245276 rust-tests,
@@ -256,6 +287,7 @@ jobs:
256287 [ "${{ needs.typescript-typecheck.result }}" != "success" ] || \
257288 [ "${{ needs.typescript-tests.result }}" != "success" ] || \
258289 [ "${{ needs.typescript-build.result }}" != "success" ] || \
290+ [ "${{ needs.sonarcloud.result }}" != "success" ] || \
259291 [ "${{ needs.rust-format.result }}" != "success" ] || \
260292 [ "${{ needs.rust-clippy.result }}" != "success" ] || \
261293 [ "${{ needs.rust-tests.result }}" != "success" ] || \
0 commit comments