Skip to content

Commit

Permalink
feat: add sonar cloud integration
Browse files Browse the repository at this point in the history
  • Loading branch information
OS-martacarlos committed Jun 20, 2024
1 parent caf4d5a commit 05e1bb3
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/run_unit_tests_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Run Unit Tests

on:
workflow_dispatch:
push:
branches: [ main, development ]
pull_request:
branches: [ main, development ]

jobs:
test:
name: Unit-Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install dependencies
run: npm install

- name: Run tests (with coverage)
run: npm test -- --coverage --ci

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
SONAR_TOKEN: ${{ secrets. SONAR_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
package-lock.json
coverage
22 changes: 22 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Organization and project keys are displayed in the right sidebar of the project homepage
sonar.organization=outsystemsrd
sonar.projectKey=OutSystems_OneSignal-Cordova-SDK
sonar.host.url=https://sonarcloud.io

sonar.language=ts

# Path is relative to the sonar-project.properties file. Defaults to .
sonar.sources=src
sonar.tests=test

# Defining path to coverage file
sonar.javascript.lcov.reportPaths=./coverage/lcov.info

# Specify the TypeScript file suffixes
sonar.typescript.file.suffixes=.ts,.tsx

# Define TS lint
sonar.typescript.tslint.reportPaths=tslint-report.json

# Exclude directories
sonar.exclusions=**/node_modules/**,**/*.spec.ts, **/*.java

0 comments on commit 05e1bb3

Please sign in to comment.