Skip to content

chore: fix analyze #123

chore: fix analyze

chore: fix analyze #123

name: Unit tests - on emulator
on: push
jobs:
test:
runs-on: macos-latest
strategy:
matrix:
api-level: [31]
steps:
- name: checkout
uses: actions/checkout@v4
- name: Use FVM
uses: kuhnroyal/flutter-fvm-config-action@v1
id: fvm-config-action
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
- name: Install app dependencies
run: flutter pub get
- name: Analyze files
run: flutter analyze
- name: Verify formatting
run: dart format --output=none --set-exit-if-changed .
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Gradle cache
uses: gradle/gradle-build-action@v2
- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}
- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: ReactiveCircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Run Unit Tests Under Android Emulator Runner
uses: ReactiveCircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: cd example && flutter test integration_tests/on_emulator_test.dart