diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index a2d6c27..1cbfbcb 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -4,6 +4,11 @@ jobs: build: name: Run integration test runs-on: macOS-latest + strategy: + matrix: + api-level: [ 21, 33 ] + target: [ google_apis ] + arch: [ x86_64 ] steps: - name: Checkout uses: actions/checkout@v4.1.1 @@ -16,11 +21,37 @@ jobs: uses: subosito/flutter-action@v2.12.0 with: channel: 'stable' - - name: Create emulator + - 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: 29 + api-level: ${{ matrix.api-level }} + target: ${{ matrix.target }} + arch: ${{ matrix.arch }} + 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 tests + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: ${{ matrix.api-level }} + target: ${{ matrix.target }} + arch: ${{ matrix.arch }} + 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: ./gradlew connectedAndroidTest - run: flutter doctor -v - run: flutter pub get - run: flutter pub run build_runner build --delete-conflicting-outputs