Merge pull request #947 from synonymdev/fix/logs-spam-and-size #539
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: | |
| inputs: | |
| suites: | |
| description: "Android test annotations: all or comma-separated simple annotation names" | |
| required: false | |
| default: "all" | |
| type: string | |
| 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@v6 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '17' | |
| distribution: 'adopt' | |
| - name: Cache gradle | |
| uses: actions/cache@v5 | |
| 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@v5 | |
| 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 | |
| env: | |
| ANDROID_TEST_SUITES: ${{ github.event.inputs.suites || 'all' }} | |
| 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: bash .github/scripts/run-ui-tests.sh | |
| - name: Upload UI test report | |
| if: always() | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: compose_test_report | |
| path: | | |
| app/build/reports/androidTests/connected/**/* | |
| app/build/outputs/androidTest-results/connected/**/* | |
| if-no-files-found: warn |