Skip to content

Commit 2e6608b

Browse files
committed
fixes actions
1 parent d21fcab commit 2e6608b

File tree

4 files changed

+65
-0
lines changed

4 files changed

+65
-0
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
pull_request:
88
types: [opened, synchronize, reopened]
99
merge_group:
10+
permissions:
11+
contents: read
1012

1113
jobs:
1214
build:

.github/workflows/sonarqube.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: SonarQube
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
merge_group:
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
sonarqube:
15+
name: SonarQube
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js 20.x
22+
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
23+
with:
24+
node-version: 20.x
25+
26+
- name: Install pnpm
27+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
28+
29+
- name: Install dependencies
30+
run: pnpm install
31+
32+
- name: Run tests with coverage
33+
run: |
34+
pnpm test:coverage
35+
- name: SonarQube Scan
36+
uses: SonarSource/sonarqube-scan-action@2500896589ef8f7247069a56136f8dc177c27ccf
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
39+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
pull_request:
88
types: [opened, synchronize, reopened]
99
merge_group:
10+
permissions:
11+
contents: read
1012

1113
jobs:
1214
test:

sonar-project.properties

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# SonarQube Configuration for Formbricks React Native
2+
sonar.projectKey=formbricks_react-native
3+
sonar.organization=formbricks
4+
5+
# Source code paths
6+
sonar.sources=packages/react-native/src,apps/playground/src
7+
sonar.tests=packages/react-native/src
8+
9+
sonar.test.inclusions=**/*.test.*,**/*.spec.*
10+
11+
# General exclusions
12+
sonar.exclusions=**/node_modules/**,**/dist/**,**/build/**,**/coverage/**,**/.turbo/**,**/apps/playground/**,**/*.config.js,**/*.config.ts,**/vite.config.ts,**/vitest.setup.ts,**/tsconfig.json,**/package.json,**/pnpm-lock.yaml,**/turbo.json,**/pnpm-workspace.yaml
13+
14+
# Language specific settings
15+
sonar.javascript.lcov.reportPaths=packages/react-native/coverage/lcov.info
16+
sonar.typescript.tsconfigPath=packages/react-native/tsconfig.json,apps/playground/tsconfig.json
17+
18+
# React Native specific exclusions
19+
sonar.exclusions=**/assets/**,**/android/**,**/ios/**,**/android/**/*,**/ios/**/*,**/*.gradle,**/*.plist,**/*.pbxproj,**/*.xcworkspace,**/*.xcodeproj
20+
21+
# Coverage settings
22+
sonar.coverage.exclusions=**/node_modules/**,**/dist/**,**/build/**,**/coverage/**,**/.turbo/**,**/apps/playground/**,**/*.config.js,**/*.config.ts,**/vite.config.ts,**/vitest.setup.ts,**/tsconfig.json,**/package.json,**/pnpm-lock.yaml,**/turbo.json,**/pnpm-workspace.yaml

0 commit comments

Comments
 (0)