Skip to content

Disabled avd cache

Disabled avd cache #2

name: Android clean build
on:
push:
branches:
- "feature/CiBuildTest"
jobs:
android_clean_build:
runs-on: ubuntu-22.04
strategy:
matrix:
api-level: [ 33, 34 ]
flutter-version: [ "3.16.0" ,"3.19.0", "3.22.0" ]
steps:
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.flutter-version }}
channel: 'stable'
cache: true
cache-key: ${{ matrix.flutter-version }}
- run: |
flutter create --template=app --platforms=android,ios demo_project
cd demo_project
sed -i 's/"org.jetbrains.kotlin.android" version "1.7.10"/"org.jetbrains.kotlin.android" version "1.8.10"/g' android/settings.gradle
flutter pub add adyen_checkout
flutter build apk --debug
- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: false
# - name: AVD cache
# uses: actions/cache@v4
# 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 }}
# target: google_apis
# 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 connectedDebugAndroidTest
uses: reactivecircus/android-emulator-runner@v2
env:
ADYEN_ANDROID_MERCHANT_SERVER_URL: 'https://android-ui-tests.adyen.com/'
ADYEN_ANDROID_CLIENT_KEY: 'test_fakefakefakefakefakefakefakefake'
with:
api-level: ${{ matrix.api-level }}
target: google_apis
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: false
working-directory: ./demo_project
script: |
echo "Emulator launched"
adb install build/app/outputs/flutter-apk/app-debug.apk
adb shell monkey -p com.example.demo_project -c android.intent.category.LAUNCHER 1