Skip to content

Commit 2d220b1

Browse files
committed
fix sonarqube dummy configuration
1 parent abf484c commit 2d220b1

File tree

4 files changed

+78
-29
lines changed

4 files changed

+78
-29
lines changed
+34-29
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
1-
name: 'sonarqube'
2-
3-
on: push
4-
5-
jobs:
6-
sonarQubeTrigger:
7-
name: Sonarqube-Trigger
8-
runs-on: ubuntu-latest
9-
steps:
10-
- uses: dart-lang/setup-dart@v1
11-
- name: Checkout code
12-
uses: actions/checkout@v2
13-
- name: Set up Flutter
14-
uses: subosito/flutter-action@v2
15-
with:
16-
channel: stable
17-
flutter-version: 3.22.3
18-
- run: flutter --version
19-
- name: Get Dependencies
20-
run: flutter pub get app && flutter pub get modules/domain && flutter pub get modules/data && flutter pub get modules/common
21-
- name: Analyze App
22-
#run analyze first
23-
run: flutter analyze
24-
- name: Setup Sonarqube Scanner
25-
uses: warchant/setup-sonar-scanner@v8
26-
- name: Run Sonarqube Scanner
27-
run: sonar-scanner
28-
-Dsonar.token=${{ secrets.SONAR_TOKEN }}
29-
-Dsonar.host.url=${{ secrets.SONAR_URL }}
1+
#SonarQube Configuration
2+
# This is the sonarqube configuration, check readme for instructions
3+
#name: 'sonarqube'
4+
#
5+
#on: push
6+
#
7+
#jobs:
8+
# sonarQubeTrigger:
9+
# name: Sonarqube-Trigger
10+
# runs-on: ubuntu-latest
11+
# steps:
12+
# - uses: dart-lang/setup-dart@v1
13+
# - name: Checkout code
14+
# uses: actions/checkout@v2
15+
# - uses: webfactory/[email protected]
16+
# with:
17+
# ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
18+
# - name: Set up Flutter
19+
# uses: subosito/flutter-action@v2
20+
# with:
21+
# channel: stable
22+
# flutter-version: 3.24.3
23+
# - run: flutter --version
24+
# - name: Get Dependencies
25+
# run: flutter pub get app && flutter pub get modules/domain && flutter pub get modules/data && flutter pub get modules/common
26+
# - name: Analyze App
27+
# #run analyze first
28+
# run: flutter analyze
29+
# - name: Setup Sonarqube Scanner
30+
# uses: warchant/setup-sonar-scanner@v8
31+
# - name: Run Sonarqube Scanner
32+
# run: sonar-scanner
33+
# -Dsonar.token=${{ secrets.SONAR_TOKEN }}
34+
# -Dsonar.host.url=${{ secrets.SONAR_URL }}

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,20 @@ the [CI/CD pipelines](https://www.notion.so/rootstrap/Flutter-CI-CD-9a0a5957ee84
196196
- OPENAI_KEY
197197
198198
### Github Actions: Sonarqube
199+
- Go to you sonarqube server and configure a new project.
200+
- Configure the sonar-project.properties:
201+
example:
202+
'''
203+
sonar.projectKey=your-app-key
204+
sonar.projectName=your-project-name
205+
sonar.host.url=https://your-sonarqube-server.net
206+
sonar.projectVersion=1.0
207+
sonar.sourceEncoding=UTF-8
208+
'''
209+
# Main source directories
210+
sonar.sources=app/lib,modules/domain,modules/data,modules/common
211+
sonar.dart.exclusions=pubspec.yaml
212+
sonar.dart.analyzer.report.mode=LEGACY
199213
- Configure Sonarqube secrets vars on your repo settings:
200214
- SONAR_TOKEN (your sonarqube project token)
201215
- SONAR_URL (your sonarqube server url)

pubspec.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This config file is for Sonarqube only
2+
name: Sonar
3+
description: Sonar
4+
5+
publish_to: "none"
6+
version: 0.0.1+1
7+
8+
environment:
9+
sdk: '>=3.0.0 <4.0.0'
10+
11+
dependencies:
12+
flutter:
13+
sdk: flutter
14+
15+
dev_dependencies:
16+
flutter_test:
17+
sdk: flutter
18+
19+
flutter:
20+
generate: true
21+
uses-material-design: true

sonar-project.properties

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
sonar.projectKey=tax-app-aaa
2+
sonar.projectName=tax-app-aaa
3+
sonar.host.url=https://sonarqube-developers.rootstrap.net
4+
sonar.projectVersion=1.0
5+
sonar.sourceEncoding=UTF-8
6+
# Main source directories
7+
sonar.sources=app/lib,modules/domain,modules/data,modules/common
8+
sonar.dart.exclusions=pubspec.yaml
9+
sonar.dart.analyzer.report.mode=LEGACY

0 commit comments

Comments
 (0)