feat: Unified method for detecting a Wayland session #30
Workflow file for this run
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: Android Screenshot Test | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - v3.7 | |
| - v3.6 | |
| - v3.5 | |
| - v3.4 | |
| - v3.3 | |
| - ios-2024_2 | |
| pull_request: | |
| jobs: | |
| screenshot-test-android: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v6.0.2 | |
| - name: Setup the java environment | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '25' | |
| - 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@v5 | |
| - name: AVD cache | |
| uses: actions/cache@v5 | |
| id: avd-cache | |
| with: | |
| path: | | |
| ~/.android/avd/* | |
| ~/.android/adb* | |
| key: avd-35 | |
| - name: Run Android Screenshot Test | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: 35 | |
| avd-name: test_avd | |
| target: google_apis | |
| arch: x86_64 | |
| force-avd-creation: true | |
| ram-size: 4096M | |
| heap-size: 2048M | |
| profile: pixel_tablet | |
| emulator-options: -no-window -gpu mesa -noaudio -no-boot-anim -camera-back none -no-snapshot -no-snapshot-save -no-snapshot-load | |
| disable-animations: false | |
| script: > | |
| curl -L https://maven.google.com/androidx/test/services/test-services/1.6.0/test-services-1.6.0.apk --output test-services-1.6.0.apk; | |
| adb install -r -g test-services-1.6.0.apk; | |
| adb uninstall org.jmonkeyengine.screenshottests.android || true; | |
| ./gradlew :jme3-screenshot-tests:jme3-screenshot-tests-android:connectedDebugAndroidTest; | |
| exit_code=$?; | |
| mkdir -p logcat; | |
| adb logcat -d > logcat/logcat_full.txt || true; | |
| adb logcat -d | grep org.jmonkeyengine.screenshottests.android > logcat/logcat.txt || true; | |
| mkdir -p report; | |
| adb pull /storage/emulated/0/googletest/test_outputfiles/report report/protoReport || true; | |
| adb pull /storage/emulated/0/googletest/test_outputfiles/changed-images report/changed-images || true; | |
| ./gradlew :jme3-screenshot-tests:jme3-screenshot-tests-proto-report:upgradeProtoReport --args="$(pwd)/report/protoReport $(pwd)/report/extentReport" || true; | |
| echo "GRADLE_EXIT_CODE=$exit_code" >> $GITHUB_ENV; | |
| exit $exit_code | |
| - name: Upload logcat | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: android-logcat | |
| path: logcat | |
| - name: Upload Screenshot | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: android-screenshot-report | |
| path: report | |
| if-no-files-found: error |