UI Tests #41
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "UI Tests" | |
on: | |
workflow_dispatch: | |
jobs: | |
ui_tests: | |
runs-on: macos-latest | |
timeout-minutes: 45 | |
strategy: | |
matrix: | |
# test on the minimum, a more recent version and the current maximum | |
android: [ 21, 28, 34 ] | |
fail-fast: false | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Display branch name | |
run: | | |
echo "current branch: $GITHUB_REF" | |
- name: Init submodules | |
run: git submodule update --init --recursive | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 20 # JDK 21 is still unsupported by Kotlin | |
check-latest: true | |
- name: Set up Gradle cache | |
uses: actions/cache@v3 | |
id: gradle-cache | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Set up AVD cache | |
uses: actions/cache@v3 | |
id: avd-cache | |
with: | |
path: | | |
~/.android/avd/* | |
~/.android/adb* | |
key: avd-${{ matrix.android }} | |
- name: Create AVD and generate snapshot for caching | |
if: steps.avd-cache.outputs.cache-hit != 'true' | |
uses: reactivecircus/android-emulator-runner@v2.27.0 | |
with: | |
api-level: ${{ matrix.android }} | |
arch: x86_64 | |
force-avd-creation: false | |
emulator-options: >- | |
-no-boot-anim -no-audio -no-snapshot -no-window -camera-back none | |
-camera-front none -gpu swiftshader_indirect | |
disable-animations: false | |
script: echo "Generated AVD snapshot for caching." | |
- name: Run UI Tests | |
uses: reactivecircus/android-emulator-runner@v2.27.0 | |
with: | |
api-level: ${{ matrix.android }} | |
arch: x86_64 | |
force-avd-creation: false | |
emulator-options: >- | |
-no-snapshot-save -no-boot-anim -no-audio -no-snapshot -no-window -camera-back none | |
-camera-front none -gpu swiftshader_indirect | |
disable-animations: true | |
script: ./gradlew connectedAndroidTest --no-daemon --info |