-
-
Notifications
You must be signed in to change notification settings - Fork 54
193 lines (175 loc) · 7.07 KB
/
bobtests_linux.yml
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: Linux Bob Tests
on:
push:
paths-ignore:
- 'README.md'
- '.github/workflows/android.yml'
pull_request:
paths-ignore:
- 'README.md'
- '.github/workflows/android.yml'
workflow_dispatch:
inputs:
version:
description: dummy
default: dummy
jobs:
android-linux-test_bob:
runs-on: ubuntu-latest
strategy:
matrix:
api-level: [29]
permissions:
contents: write
if: ${{ true }}
steps:
- uses: actions/checkout@v4
- name: install deps
run: |
sudo apt-get update && \
sudo DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends \
fonts-freefont-otf \
adb \
ghostscript \
imagemagick \
ca-certificates
- name: check imagemagick
run: |
convert -list font || echo "NO ERR"
- name: Install Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: |
11
- name: Enable KVM group perms
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: test java1
run: |
pwd
type java
echo "===========1========="
java -version || exit 0
echo "===========2========="
- name: download tester
shell: bash
run: |
curl -L https://github.com/zoff99/java_tox_tester/archive/refs/heads/master.zip -o master.zip
unzip master.zip
ls -al java_tox_tester-master/
java -version
javac -version
- name: start tester
shell: bash
run: |
cd java_tox_tester-master/ ; ls -al ; ./do_wait_for_app.sh &
- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}
- 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: ${{ matrix.api-level }}
profile: Nexus 6
arch: x86_64
ndk: 21.0.6113669
cmake: 3.10.2.4988404
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
disable-spellchecker: true
script: echo "Generated AVD snapshot for caching."
- name: android test
timeout-minutes: 30
continue-on-error: true
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
profile: Nexus 6
arch: x86_64
ndk: 21.0.6113669
cmake: 3.10.2.4988404
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
disable-spellchecker: true
script: |
df -h
rm -f /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/android-refimpl-app/app/witness.gradle
sed -i -e 's#a.getWindow().addFlags#//a.getWindow().addFlagsXXYY#' /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/android-refimpl-app/app/src/main/java/com/zoffcc/applications/trifa/CallingActivity.java
printf 'dependencyVerification {\nverify = [\n]\n}\n' > /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/android-refimpl-app/app/witness.gradle
java -version
cd android-refimpl-app ; ./gradlew assemble
adb logcat -c || echo "NOERR"
adb logcat > /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/android-refimpl-app/logcat.txt &
echo 'sleep 100' > /home/runner/a.sh
echo 'sleep 40' >> /home/runner/a.sh
echo 'sleep 10' >> /home/runner/a.sh
echo 'sleep 10' >> /home/runner/a.sh
echo 'sleep 10' >> /home/runner/a.sh
cat /home/runner/a.sh
ls -al /home/runner/a.sh
chmod u+rx /home/runner/a.sh
bash /home/runner/a.sh &
cd android-refimpl-app ; ./gradlew app:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=com.zoffcc.applications.trifa.JavaFriendTester || echo "NOERR"
pwd
adb pull /sdcard/googletest/test_outputfiles .
ls -al /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/test_outputfiles/
echo "---------------"
ls -al /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/test_outputfiles/*.png
- name: put datetime on screenshots
run: |
cd /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/
git rev-parse --short HEAD
c="$(git rev-parse --short HEAD)"
cd /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/test_outputfiles/
ls -al
d="$(date '+%Y-%m-%d %H:%M:%S')"
convert test_004b.png -gravity SouthEast -pointsize 62 -fill white -annotate +30+30 "$d ($c)" test_004b_time.png
convert test_099.png -gravity SouthEast -pointsize 62 -fill white -annotate +30+30 "$d ($c)" test_099_time.png
mv test_004b_time.png test_004b.png
mv test_099_time.png test_099.png
- name: upload screenshots
uses: actions/upload-artifact@v4
with:
name: linuxscreen
path: |
/home/runner/screen*.png
/home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/test_outputfiles/*.png
- name: upload logcat output
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: logcat
path: |
/home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/android-refimpl-app/logcat.txt
- name: Rename artifact for nightly upload
if: github.event_name == 'push' && github.ref == 'refs/heads/zoff99/dev003'
run: |
pwd
cp -av /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/test_outputfiles/test_004b.png screen_shot_android_02.png
cp -av /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/test_outputfiles/test_099.png screen_shot_android_03.png
- name: Upload to nightly release
uses: ncipollo/release-action@v1
if: github.event_name == 'push' && github.ref == 'refs/heads/zoff99/dev003'
with:
allowUpdates: true
tag: nightly
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
prerelease: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "screen_shot_android_02.png,screen_shot_android_03.png"