commit 34e65930ebc0bf668667a09e8c17af9f635f7e32
parent fc2b73dccd26b9b034227ed8eae5380117128cfc
Author: MTRNord <MTRNord@users.noreply.github.com>
Date: Sat, 2 Aug 2025 18:20:08 +0200
Ensure we got a workiung emulator on the test ci
Diffstat:
2 files changed, 39 insertions(+), 8 deletions(-)
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
@@ -15,13 +15,44 @@ jobs:
with:
distribution: 'temurin'
java-version: '17'
+ - name: Setup Gradle
+ uses: gradle/actions/setup-gradle@v3
- name: Build and run unit tests
run: ./gradlew test
+ - 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-36
+ - 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: 36
+ 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: Build and run instrumented tests (UI & Accessibility)
- run: ./gradlew connectedAndroidTest
- env:
- # Set up a virtual display for instrumented tests
- DISPLAY: ':99.0'
+ uses: reactivecircus/android-emulator-runner@v2
+ with:
+ api-level: 36
+ 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: true
+ script: ./gradlew connectedAndroidTest
- name: Upload test reports
if: always()
uses: actions/upload-artifact@v4
@@ -29,5 +60,4 @@ jobs:
name: test-reports
path: |
app/build/reports/
- app/build/outputs/androidTest-results/
-
+ app/build/test-results/
diff --git a/.gitignore b/.gitignore
@@ -14,4 +14,5 @@
.cxx
local.properties
.idea/
-.kotlin/
-\ No newline at end of file
+.kotlin/
+/app/release
+\ No newline at end of file