Merge pull request #547 from synonymdev/fix/ln-swipe-color #343
This file contains hidden or 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: | |
| push: | |
| branches: [ "master" ] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| ui-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'adopt' | |
| - name: Cache gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| gradle-${{ runner.os }}- | |
| - name: Decode google-services.json | |
| run: echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 -d > app/google-services.json | |
| env: | |
| GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }} | |
| - name: Make gradlew executable | |
| run: chmod +x gradlew | |
| - name: Build debug app | |
| env: | |
| GITHUB_ACTOR: ${{ github.actor }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CHATWOOT_API: ${{ secrets.CHATWOOT_API }} | |
| run: | | |
| ./gradlew assembleDevDebug assembleDevDebugAndroidTest | |
| ls -la app/build/outputs/apk/debug/ | |
| ls -la app/build/outputs/apk/androidTest/debug/ | |
| - 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: AVD cache | |
| uses: actions/cache@v4 | |
| id: avd-cache | |
| with: | |
| path: | | |
| ~/.android/avd/* | |
| ~/.android/adb* | |
| key: avd-30-x86_64 | |
| - 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: 30 | |
| arch: x86_64 | |
| profile: pixel_4 | |
| 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 UI tests on Android Emulator | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: 30 | |
| arch: x86_64 | |
| profile: pixel_4 | |
| 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: | | |
| # Wait for emulator to be fully ready | |
| adb wait-for-device | |
| echo "Waiting for boot to complete..." | |
| adb shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done' | |
| sleep 10 | |
| # Verify emulator ABI matches app | |
| echo "Emulator ABI:" | |
| adb shell getprop ro.product.cpu.abi | |
| # Install and run tests | |
| ./gradlew installDevDebug | |
| ./gradlew connectedDevDebugAndroidTest | |
| - name: Upload UI test report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: compose_test_report | |
| path: | | |
| app/build/reports/androidTests/connected/**/* | |
| app/build/outputs/androidTest-results/connected/**/* | |
| if-no-files-found: warn |