From 370d2722a3ffe74b25b3939251d9142eb591862e Mon Sep 17 00:00:00 2001 From: Minseong Kim <57604817+jja08111@users.noreply.github.com> Date: Tue, 3 Sep 2024 20:07:29 +0900 Subject: [PATCH] Fix UI test in ci.yaml --- .github/workflows/ci.yaml | 45 ++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 419553b..cd8b5f6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -34,28 +34,49 @@ jobs: ui-test: name: UI tests on Android (API level ${{ matrix.api-level }}) - runs-on: macos-latest + runs-on: ubuntu-latest strategy: matrix: - api-level: [ 26, 28, 34 ] + api-level: [ 26, 28, 33 ] + target: [ google_apis ] + arch: [ x86_64 ] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - - name: Setup JDK 17 - uses: actions/setup-java@v3 + - 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: Gradle cache + uses: gradle/actions/setup-gradle@v3 + + - name: AVD cache + uses: actions/cache@v4 + id: avd-cache with: - java-version: '17' - distribution: 'temurin' - cache: gradle + path: | + ~/.android/avd/* + ~/.android/adb* + key: avd-${{ matrix.api-level }} - - name: Setup Android SDK - uses: android-actions/setup-android@v2 + - 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 + disable-animations: false + script: echo "Generated AVD snapshot for caching." - - name: UI test + - name: Run tests 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 disable-animations: true - arch: x86_64 script: ./gradlew connectedCheck