fix: call real api and fix problems #122
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SonarQube Cloud | |
on: | |
push: | |
branches: | |
- sonar | |
- main | |
pull_request: | |
branches: | |
- sonar | |
- main | |
types: [ opened, synchronize, reopened ] | |
jobs: | |
build: | |
name: Build and analyze | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/cirruslabs/flutter:3.27.1 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
# - name: Setup Flutter | |
# uses: subosito/[email protected] | |
# with: | |
# flutter-version: 3.24.5 | |
# channel: stable | |
# - name: Setup Dart | |
# uses: dart-lang/[email protected] | |
# with: | |
# dart-version: 3.5.4 | |
# - name: Setup Java JDK 17 | |
# uses: actions/setup-java@v4 | |
# with: | |
# distribution: 'temurin' | |
# java-version: '17' | |
# - name: set JAVA_HOME | |
# run: echo "JAVA_HOME=/usr/lib/jvm/temurin-17-jdk-amd64" >> $GITHUB_ENV | |
# - name: flutter jdk configuration | |
# run: flutter config --jdk-dir /usr/lib/jvm/temurin-17-jdk-amd64 | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Analyze | |
run: flutter analyze | |
- name: Run tests | |
run: flutter test --coverage | |
- name: Cache SonarQube Cloud packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Build | |
run: flutter build apk --release --target lib/main/main_prod.dart | |
- name: Download sonar-scanner | |
run: | | |
curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.2.1.4610-linux-x64.zip | |
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ | |
- name: Build and analyze | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: | | |
$HOME/.sonar/sonar-scanner-6.2.1.4610-linux-x64/bin/sonar-scanner \ | |
-Dsonar.projectKey=cevheri_flutter-bloc-advanced \ | |
-Dsonar.organization=cevheri-open-source \ | |
-Dsonar.sources=. \ | |
-Dsonar.host.url=https://sonarcloud.io |