Skip to content

chore: setup sonar cloud #36

chore: setup sonar cloud

chore: setup sonar cloud #36

Workflow file for this run

name: Code Quality Check
on:
push:
branches: [main]
pull_request:
branches: ["*"]
jobs:
code-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
- run: flutter pub get
- run: flutter analyze
- run: flutter pub run dart_code_metrics:metrics analyze lib
- run: flutter test
sonarqube:
name: SonarQube
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
#2 Setup Java
- name: Set Up Java
uses: actions/[email protected]
with:
distribution: "oracle"
java-version: "17"
#3 Setup Flutter
- name: Set Up Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
#4 Install Dependencies
- name: Install Dependencies
run: flutter pub get
#5 Run flutter tests
- name: Run Flutter Tests
run: flutter test --coverage
#6 Run Sonar cloud scan
- name: Build
run: flutter build apk
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}