Skip to content

Commit a8242a2

Browse files
chore: setup sonar cloud
1 parent bc65ed1 commit a8242a2

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

.github/workflows/main.yml

+35
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,38 @@ jobs:
2424
- run: flutter pub run dart_code_metrics:metrics analyze lib
2525

2626
- run: flutter test
27+
28+
sonarqube:
29+
name: SonarQube
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
35+
#2 Setup Java
36+
- name: Set Up Java
37+
uses: actions/[email protected]
38+
with:
39+
distribution: "oracle"
40+
java-version: "17"
41+
#3 Setup Flutter
42+
- name: Set Up Flutter
43+
uses: subosito/flutter-action@v2
44+
with:
45+
channel: "stable"
46+
#4 Install Dependencies
47+
- name: Install Dependencies
48+
run: flutter pub get
49+
#5 Run flutter tests
50+
- name: Run Flutter Tests
51+
run: flutter test --coverage
52+
#6 Run Sonar cloud scan
53+
54+
- name: Build
55+
run: flutter build apk
56+
57+
- name: SonarQube Scan
58+
uses: SonarSource/sonarqube-scan-action@v4
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
61+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

sonar-project.properties

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
sonar.projectKey=ricardodalarme_Nubank-Clone
2+
sonar.organization=ricardodalarme
3+
4+
# This is the name and version displayed in the SonarCloud UI.
5+
#sonar.projectName=Nubank-Clone
6+
#sonar.projectVersion=1.0
7+
8+
9+
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
10+
#sonar.sources=./lib/
11+
12+
# Encoding of the source code. Default is default system encoding
13+
#sonar.sourceEncoding=UTF-8

0 commit comments

Comments
 (0)