Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,14 @@ jobs:
- name: Install dependencies
run: npm ci --legacy-peer-deps

- name: Run tests
run: npm test
- name: Run tests with coverage
run: npm run test:coverage

- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/lcov.info

typescript-build:
name: TypeScript Build
Expand All @@ -120,6 +126,29 @@ jobs:
env:
EXPO_NO_TELEMETRY: 1

sonarcloud:
name: SonarCloud Analysis
runs-on: ubuntu-latest
needs: [typescript-tests]
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download coverage report
uses: actions/download-artifact@v4
with:
name: coverage-report
path: coverage

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

# ─────────────────────────────────────────────────────────
# Rust / Soroban Smart Contract Checks
# ─────────────────────────────────────────────────────────
Expand Down Expand Up @@ -217,6 +246,7 @@ jobs:
typescript-typecheck,
typescript-tests,
typescript-build,
sonarcloud,
rust-format,
rust-clippy,
rust-tests,
Expand All @@ -240,6 +270,7 @@ jobs:
typescript-typecheck,
typescript-tests,
typescript-build,
sonarcloud,
rust-format,
rust-clippy,
rust-tests,
Expand All @@ -256,6 +287,7 @@ jobs:
[ "${{ needs.typescript-typecheck.result }}" != "success" ] || \
[ "${{ needs.typescript-tests.result }}" != "success" ] || \
[ "${{ needs.typescript-build.result }}" != "success" ] || \
[ "${{ needs.sonarcloud.result }}" != "success" ] || \
[ "${{ needs.rust-format.result }}" != "success" ] || \
[ "${{ needs.rust-clippy.result }}" != "success" ] || \
[ "${{ needs.rust-tests.result }}" != "success" ] || \
Expand Down
20 changes: 20 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
sonar.projectKey=Smartdevs17_SubTrackr
sonar.organization=smartdevs17

# This is the name and version displayed in the SonarCloud UI.
sonar.projectName=SubTrackr
sonar.projectVersion=1.0

# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
sonar.sources=src
sonar.tests=src
sonar.test.inclusions=**/*.test.tsx,**/*.test.ts

# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8

# Coverage report paths
sonar.javascript.lcov.reportPaths=coverage/lcov.info

# Exclusions
sonar.exclusions=**/node_modules/**,**/dist/**,**/build/**,**/contracts/**,**/stellarlend/**,assets/**