prasule/.forgejo/workflows/sq_analyze.yml

45 lines
1.9 KiB
YAML
Raw Normal View History

2024-07-17 20:11:44 +02:00
on:
push:
branches:
- 'dev'
env:
SONAR_TOKEN: ${{ secrets.SQ_KEY }}
jobs:
build:
runs-on: flutter-beta
steps:
- name: Initialize scanner
run: |
export SONAR_SCANNER_VERSION=6.0.0.4432
export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
export PATH=$SONAR_SCANNER_HOME/bin:$PATH
export SONAR_SCANNER_OPTS="-server"
- name: Initialize AVD
run: |
sdkmanager "platform-tools" "platforms;android-${{ vars.ANDROID_API }}"
2024-07-17 20:20:25 +02:00
sdkmanager --install "system-images;android-${{ vars.ANDROID_API }};${{ vars.ANDROID_TARGET }};${{ vars.ANDROID_ARCH }}"
2024-07-17 20:11:44 +02:00
sdkmanager --update
echo "y" | sdkmanager --licenses
sdkmanager --list
2024-07-17 20:20:25 +02:00
echo "no" | avdmanager -v create avd --force --name "android_emulator" --package "system-images;android-${{ vars.ANDROID_API }};${{vars.ANDROID_TARGET}};${{ vars.ANDROID_ARCH }}" --tag "${{vars.ANRDOID_TARGET}}" --sdcard 128M --device "${{ vars.ANDROID_DEVICE }}"
2024-07-17 20:11:44 +02:00
emulator -avd "android_emulator" -no-audio -no-window -no-snapstorage -no-snapshot -gpu swiftshader_indirect -no-boot-anim -no-accel -wipe-data -skip-adb-auth &
adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done; input keyevent 82'
flutter doctor -v
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
flutter pub get
- name: Run tests
run: |
flutter test integration_test/app_test.dart --coverage --reporter json > tests.output
- name: Run scanner
run: |
sonar-scanner