|
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 }} |
| 1 | +# name: sonarqube |
| 2 | + |
| 3 | +# # ──────────────────────────────────────────────────────────────── |
| 4 | +# # CI TRIGGERS |
| 5 | +# # · push on main → historical baseline |
| 6 | +# # · pull_request PRs → quality gate before merge |
| 7 | +# # ──────────────────────────────────────────────────────────────── |
| 8 | +# on: |
| 9 | +# push: |
| 10 | +# branches: [main] |
| 11 | +# pull_request: |
| 12 | +# types: [opened, synchronize, reopened] |
| 13 | + |
| 14 | +# jobs: |
| 15 | +# sonarQubeTrigger: |
| 16 | +# name: Sonarqube Trigger |
| 17 | +# runs-on: ubuntu-latest |
| 18 | + |
| 19 | +# steps: |
| 20 | +# # 1 — Checkout the repo |
| 21 | +# - name: Checkout code |
| 22 | +# uses: actions/checkout@v3 |
| 23 | + |
| 24 | +# # 2 — SSH agent for any Git-based pub dependencies |
| 25 | +# - name: Start ssh-agent |
| 26 | +# uses: webfactory/[email protected] |
| 27 | +# with: |
| 28 | +# ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} |
| 29 | + |
| 30 | +# # 3 — Install Dart SDK |
| 31 | +# - uses: dart-lang/setup-dart@v1 |
| 32 | + |
| 33 | +# # 4 — Install Flutter SDK |
| 34 | +# - name: Set up Flutter |
| 35 | +# uses: subosito/flutter-action@v2 |
| 36 | +# with: |
| 37 | +# channel: stable |
| 38 | +# flutter-version: 3.24.3 |
| 39 | + |
| 40 | +# # 5 — Install all pub packages (app + each module) |
| 41 | +# - name: Get pub packages |
| 42 | +# run: | |
| 43 | +# set -e |
| 44 | +# for dir in app modules/*; do |
| 45 | +# if [ -f "$dir/pubspec.yaml" ]; then |
| 46 | +# echo "▶ flutter pub get --directory $dir" |
| 47 | +# flutter pub get --directory "$dir" |
| 48 | +# fi |
| 49 | +# done |
| 50 | + |
| 51 | +# # 6 — Static analysis (kept exactly as before) |
| 52 | +# - name: Analyze App |
| 53 | +# run: flutter analyze |
| 54 | + |
| 55 | +# # 7 — Install SonarScanner CLI (needed by full_coverage.py) |
| 56 | +# - name: Setup Sonarqube Scanner |
| 57 | +# uses: warchant/setup-sonar-scanner@v8 |
| 58 | + |
| 59 | +# # 8 — Run tests, build combined lcov.info and upload to SonarQube |
| 60 | +# - name: Generate coverage & run SonarQube |
| 61 | +# run: python3 coverage/full_coverage.py --ci |
| 62 | +# env: |
| 63 | +# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
| 64 | +# SONAR_URL: ${{ secrets.SONAR_URL }} |
0 commit comments