Skip to content

Commit 3f61d5a

Browse files
committed
run on CI
1 parent 4bccfd6 commit 3f61d5a

File tree

1 file changed

+118
-0
lines changed

1 file changed

+118
-0
lines changed

.github/workflows/app_startup.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Android startup
2+
on:
3+
push:
4+
paths-ignore:
5+
- 'README.md'
6+
pull_request:
7+
paths-ignore:
8+
- 'README.md'
9+
workflow_dispatch:
10+
inputs:
11+
version:
12+
description: dummy
13+
default: dummy
14+
15+
jobs:
16+
android-startup-app:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
api-level: [35, 33, 29, 21]
21+
permissions:
22+
contents: write
23+
if: ${{ true }}
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: install deps
28+
run: |
29+
sudo apt-get update && \
30+
sudo DEBIAN_FRONTEND=noninteractive \
31+
apt-get install -y --no-install-recommends \
32+
fonts-freefont-otf \
33+
adb \
34+
ghostscript \
35+
imagemagick \
36+
ca-certificates
37+
38+
- name: check imagemagick
39+
run: |
40+
convert -list font || echo "NO ERR"
41+
42+
- name: Install Java
43+
uses: actions/setup-java@v4
44+
with:
45+
distribution: 'temurin'
46+
java-version: |
47+
17
48+
49+
- name: Enable KVM group perms
50+
run: |
51+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
52+
sudo udevadm control --reload-rules
53+
sudo udevadm trigger --name-match=kvm
54+
55+
- name: test java1
56+
run: |
57+
pwd
58+
type java
59+
echo "===========1========="
60+
java -version || exit 0
61+
echo "===========2========="
62+
63+
- name: turn on more debug logging
64+
run: |
65+
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
66+
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
67+
68+
- name: android test
69+
timeout-minutes: 30
70+
continue-on-error: true
71+
uses: reactivecircus/android-emulator-runner@v2
72+
with:
73+
api-level: ${{ matrix.api-level }}
74+
profile: Nexus 6
75+
arch: x86_64
76+
ndk: 21.0.6113669
77+
cmake: 3.10.2.4988404
78+
force-avd-creation: false
79+
emulator-options: -no-snapshot-save -skin 1080x2220 -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
80+
disable-animations: true
81+
disable-spellchecker: true
82+
script: |
83+
cd android-refimpl-app ; ./gradlew build ; ./gradlew installDebug
84+
adb shell am start -n com.zoffcc.applications.trifa/com.zoffcc.applications.trifa.StartMainActivityWrapper &
85+
sleep 120
86+
adb exec-out screencap -p > ~/android_screen01_${{ matrix.api-level }}.png
87+
ls -al ~/android_screen01_${{ matrix.api-level }}.png
88+
adb logcat -d |grep -i 'trifa'
89+
adb logcat -d > ~/adb_log.txt
90+
sleep 2
91+
92+
- name: upload screenshots
93+
uses: actions/upload-artifact@v4
94+
with:
95+
name: android_startup_${{ matrix.api-level }}
96+
path: |
97+
/home/runner/android_screen*.png
98+
99+
- name: upload screenshots
100+
uses: actions/upload-artifact@v4
101+
with:
102+
name: android_startup_adb_log_${{ matrix.api-level }}
103+
path: |
104+
/home/runner/adb_log.txt
105+
106+
- name: Upload to nightly release
107+
uses: ncipollo/release-action@v1
108+
if: github.ref == 'refs/heads/android_test'
109+
with:
110+
allowUpdates: true
111+
tag: nightly
112+
omitBodyDuringUpdate: true
113+
omitNameDuringUpdate: true
114+
prerelease: true
115+
replacesArtifacts: true
116+
token: ${{ secrets.GITHUB_TOKEN }}
117+
artifacts: "/home/runner/android_screen01_${{ matrix.api-level }}.png"
118+

0 commit comments

Comments
 (0)