Fix flaky UI test (#253)

* Update Kotlin and KSP

* Downgrade Kaspresso to last released

* Update Compose compiler extension

* Fix flaky UI test

* Update AGP version

* Fix flakySafely scope

* Fix missing system image for UI tests

* Use Intel MacOS to run UI tests

* Revert "Fix missing system image for UI tests"

This reverts commit 9003c37315f253835f3788ab2fecd402fa5522be.

* Update test device API level to 34

* Use google-atd system image source

* Update managed devices declaration syntax

* Use device and syntax from now in android app

* Try ubuntu agent for UI tests

* Use an actual emulator instead of GMD

* Use only one API level 30

* Remove Android SDK setup action

* Setup Gradle before AVD

* Use x86_64 architecture

* Replace deprecated gradle setup action

* Downgrade all dependencies again

* Run only app android tests

* Remove managed devices
This commit is contained in:
Kirill Kamakin
2024-06-22 10:35:04 +02:00
committed by GitHub
parent 12ff7649bb
commit 67fc2dc393
5 changed files with 53 additions and 21 deletions

View File

@@ -21,7 +21,7 @@ jobs:
java-version: 17
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
uses: gradle/actions/setup-gradle@v3
- name: Setup Android SDK
uses: android-actions/setup-android@v3
@@ -41,7 +41,10 @@ jobs:
report_paths: './**/build/test-results/**/TEST-*.xml'
uiTests:
runs-on: macos-latest
runs-on: ubuntu-latest
strategy:
matrix:
api-level: [30]
steps:
- uses: actions/checkout@v4
with:
@@ -53,10 +56,44 @@ jobs:
java-version: 17
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
uses: gradle/actions/setup-gradle@v3
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Enable KVM group perms
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: 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 }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
arch: x86_64
disable-animations: true
disk-size: 6000M
heap-size: 600M
script: echo "Generated AVD snapshot for caching."
- name: Run tests
run: ./gradlew allDevicesCheck -Pandroid.testoptions.manageddevices.emulator.gpu=swiftshader_indirect
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
arch: x86_64
disable-animations: true
disk-size: 6000M
heap-size: 600M
script: ./gradlew :app:connectedCheck