-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
84 lines (80 loc) · 2.95 KB
/
android-screenshot.yml
File metadata and controls
84 lines (80 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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