Skip to content

fix: apply dart-fix #105

fix: apply dart-fix

fix: apply dart-fix #105

name: Unit tests - on emulator
env:
FLUTTER_VERSION: '3.7.3'
on: push
jobs:
test:
runs-on: macos-latest
strategy:
matrix:
api-level: [31]
steps:
- name: checkout
uses: actions/checkout@v3
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Install app dependencies
run: flutter pub get
- name: Analyze files
run: flutter analyze
- name: Verify formatting
run: flutter format --output=none --set-exit-if-changed .
- uses: actions/checkout@v3
- 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@v2
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