Skip to content

Commit 10596e3

Browse files
committed
add info test
1 parent a956d59 commit 10596e3

1 file changed

Lines changed: 181 additions & 0 deletions

File tree

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
name: Linux Info Tests
2+
on:
3+
push:
4+
paths-ignore:
5+
- 'README.md'
6+
- '.github/workflows/android.yml'
7+
pull_request:
8+
paths-ignore:
9+
- 'README.md'
10+
- '.github/workflows/android.yml'
11+
workflow_dispatch:
12+
inputs:
13+
version:
14+
description: dummy
15+
default: dummy
16+
17+
jobs:
18+
android-linux-test_info:
19+
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
api-level: [35, 33, 29, 21]
23+
permissions:
24+
contents: write
25+
if: ${{ true }}
26+
steps:
27+
- uses: actions/checkout@v6
28+
29+
- name: install deps
30+
run: |
31+
sudo apt-get update && \
32+
sudo DEBIAN_FRONTEND=noninteractive \
33+
apt-get install -y --no-install-recommends \
34+
fonts-freefont-otf \
35+
adb \
36+
ghostscript \
37+
imagemagick \
38+
ca-certificates
39+
40+
- name: check imagemagick
41+
run: |
42+
convert -list font || echo "NO ERR"
43+
44+
- name: Install Java
45+
uses: actions/setup-java@v5
46+
with:
47+
distribution: 'temurin'
48+
java-version: |
49+
17
50+
51+
- name: Enable KVM group perms
52+
run: |
53+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
54+
sudo udevadm control --reload-rules
55+
sudo udevadm trigger --name-match=kvm
56+
57+
- name: test java1
58+
run: |
59+
pwd
60+
type java
61+
echo "===========1========="
62+
java -version || exit 0
63+
echo "===========2========="
64+
65+
- name: turn on more debug logging
66+
run: |
67+
sed -i -e 's#final static boolean NDK_STDOUT_LOGGING =.*#final static boolean NDK_STDOUT_LOGGING = true;#' android-refimpl-app/app/src/main/java/com/zoffcc/applications/trifa/MainActivity.java
68+
sed -i -e 's#final static boolean CTOXCORE_NATIVE_LOGGING =.*#final static boolean CTOXCORE_NATIVE_LOGGING = true;#' android-refimpl-app/app/src/main/java/com/zoffcc/applications/trifa/MainActivity.java
69+
70+
- name: android test
71+
timeout-minutes: 40
72+
continue-on-error: true
73+
uses: reactivecircus/android-emulator-runner@v2
74+
with:
75+
api-level: ${{ matrix.api-level }}
76+
profile: Nexus 6
77+
arch: x86_64
78+
ndk: 21.0.6113669
79+
cmake: 3.10.2.4988404
80+
force-avd-creation: false
81+
emulator-options: -no-snapshot-save -skin 1080x2220 -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back virtualscene -camera-front webcam0
82+
disable-animations: true
83+
disable-spellchecker: true
84+
pre-emulator-launch-script: |
85+
echo "Running pre emulator launch script. Printing the working directory now:"
86+
pwd
87+
script: |
88+
df -h
89+
rm -f /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/android-refimpl-app/app/witness.gradle
90+
printf 'dependencyVerification {\nverify = [\n]\n}\n' > /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/android-refimpl-app/app/witness.gradle
91+
java -version
92+
cd android-refimpl-app ; ./gradlew assemble
93+
adb logcat -c || echo "NOERR"
94+
adb logcat > /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/android-refimpl-app/logcat.txt &
95+
echo 'sleep 100' > /home/runner/a.sh
96+
echo 'adb shell settings put secure immersive_mode_confirmations confirmed' >> /home/runner/a.sh
97+
echo 'sleep 40' >> /home/runner/a.sh
98+
echo 'adb shell settings put secure immersive_mode_confirmations confirmed' >> /home/runner/a.sh
99+
echo 'sleep 10' >> /home/runner/a.sh
100+
echo 'adb shell settings put secure immersive_mode_confirmations confirmed' >> /home/runner/a.sh
101+
echo 'sleep 10' >> /home/runner/a.sh
102+
echo 'adb shell settings put secure immersive_mode_confirmations confirmed' >> /home/runner/a.sh
103+
echo 'sleep 30' >> /home/runner/a.sh
104+
echo 'adb shell settings put secure immersive_mode_confirmations confirmed' >> /home/runner/a.sh
105+
cat /home/runner/a.sh
106+
ls -al /home/runner/a.sh
107+
chmod u+rx /home/runner/a.sh
108+
bash /home/runner/a.sh &
109+
echo "+++++++++++++++++++++++++++"
110+
adb devices
111+
echo "+++++++++++++++++++++++++++"
112+
adb shell settings get secure immersive_mode_confirmations
113+
echo "+++++++++++++++++++++++++++"
114+
adb shell settings put secure immersive_mode_confirmations confirmed
115+
echo "+++++++++++++++++++++++++++"
116+
adb shell settings get secure immersive_mode_confirmations
117+
echo "+++++++++++++++++++++++++++"
118+
cd android-refimpl-app ; ./gradlew app:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=com.zoffcc.applications.trifa.ShowMaintenanceInfo || echo "NOERR"
119+
cat /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/android-refimpl-app/logcat.txt
120+
echo "================"
121+
echo "================"
122+
pwd
123+
adb pull /sdcard/googletest/test_outputfiles .
124+
ls -al /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/test_outputfiles/
125+
echo "---------------"
126+
ls -al /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/test_outputfiles/*.png
127+
128+
- name: put datetime on screenshots
129+
run: |
130+
cd /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/
131+
git rev-parse --short HEAD
132+
c="$(git rev-parse --short HEAD)"
133+
cd /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/test_outputfiles/
134+
ls -al
135+
d="$(date '+%Y-%m-%d %H:%M:%S')"
136+
convert test_004b.png -gravity SouthEast -pointsize 62 -fill white -annotate +30+30 "$d ($c)" test_004b_time.png
137+
convert test_005.png -gravity SouthEast -pointsize 62 -fill white -annotate +30+30 "$d ($c)" test_005_time.png
138+
convert test_007.png -gravity SouthEast -pointsize 62 -fill white -annotate +30+30 "$d ($c)" test_007_time.png
139+
convert test_099.png -gravity SouthEast -pointsize 62 -fill white -annotate +30+30 "$d ($c)" test_099_time.png
140+
mv test_004b_time.png test_004b.png
141+
mv test_005_time.png test_005.png
142+
mv test_007_time.png test_007.png
143+
mv test_099_time.png test_099.png
144+
145+
- name: upload screenshots
146+
uses: actions/upload-artifact@v6
147+
with:
148+
name: linuxscreen_${{ matrix.api-level }}
149+
path: |
150+
/home/runner/screen*.png
151+
/home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/test_outputfiles/*.png
152+
153+
- name: upload logcat output
154+
continue-on-error: true
155+
uses: actions/upload-artifact@v6
156+
with:
157+
name: logcat_${{ matrix.api-level }}
158+
path: |
159+
/home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/android-refimpl-app/logcat.txt
160+
161+
- name: Rename artifact for nightly upload
162+
if: github.event_name == 'push' && github.ref == 'refs/heads/zoff99/dev003'
163+
run: |
164+
pwd
165+
cp -av /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/test_outputfiles/test_004b.png screen_shot_info_${{ matrix.api-level }}_02.png
166+
cp -av /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/test_outputfiles/test_005.png screen_shot_info_${{ matrix.api-level }}_03.png
167+
cp -av /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/test_outputfiles/test_099.png screen_shot_info_${{ matrix.api-level }}_11.png
168+
169+
- name: Upload to nightly release
170+
uses: ncipollo/release-action@v1
171+
if: github.event_name == 'push' && github.ref == 'refs/heads/zoff99/dev003'
172+
with:
173+
allowUpdates: true
174+
tag: nightly
175+
omitBodyDuringUpdate: true
176+
omitNameDuringUpdate: true
177+
prerelease: true
178+
replacesArtifacts: true
179+
token: ${{ secrets.GITHUB_TOKEN }}
180+
artifacts: "screen_shot_info_${{ matrix.api-level }}_02.png,screen_shot_info_${{ matrix.api-level }}_03.png,screen_shot_info_${{ matrix.api-level }}_11.png"
181+

0 commit comments

Comments
 (0)