Skip to content

Commit 777f6ee

Browse files
authored
Update flutter_ci.yml
1 parent 7d2bb2c commit 777f6ee

1 file changed

Lines changed: 14 additions & 17 deletions

File tree

.github/workflows/flutter_ci.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ jobs:
2424
with:
2525
fetch-depth: 0 # Quan trọng để SonarCloud so sánh code
2626

27-
- name: debug
28-
working-directory: .
29-
run: ls -la
30-
3127
- name: Setup Java
3228
uses: actions/setup-java@v4
3329
with:
@@ -44,18 +40,19 @@ jobs:
4440
- name: Install dependencies
4541
run: flutter pub get
4642

47-
- name: SonarCloud Scan
48-
uses: SonarSource/sonarcloud-github-action@v2
43+
- name: Run Sonar Scanner Native OS
4944
env:
50-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Bắt buộc để SonarCloud tự động comment báo cáo vào Pull Request
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Bắt buộc để SonarCloud tự động comment báo cáo
5146
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Token cấp quyền từ SonarCloud
52-
with:
53-
projectBaseDir: src
54-
args: >
55-
-Dsonar.organization=tqha1011
56-
-Dsonar.projectKey=tqha1011_taskmanagementapp
57-
-Dsonar.sources=lib
58-
-Dsonar.exclusions=**/*.g.dart,**/*.freezed.dart,**/*.part.dart
59-
60-
61-
47+
run: |
48+
# 1. Tải Sonar Scanner CLI (bản gốc cho Linux) trực tiếp từ máy chủ
49+
wget -q https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-linux.zip
50+
unzip -q sonar-scanner-cli-5.0.1.3006-linux.zip
51+
52+
# 2. Chạy lệnh quét trực tiếp trên Ubuntu
53+
./sonar-scanner-5.0.1.3006-linux/bin/sonar-scanner \
54+
-Dsonar.organization=tqha1011 \
55+
-Dsonar.projectKey=tqha1011_taskmanagementapp \
56+
-Dsonar.sources=lib \
57+
-Dsonar.exclusions="**/*.g.dart,**/*.freezed.dart,**/*.part.dart" \
58+
-Dsonar.host.url=https://sonarcloud.io

0 commit comments

Comments
 (0)