|
| 1 | +name: Linux Bob 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_bob: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + strategy: |
| 21 | + matrix: |
| 22 | + api-level: [29] |
| 23 | + permissions: |
| 24 | + contents: write |
| 25 | + if: ${{ true }} |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v4 |
| 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 | + - name: check imagemagick |
| 40 | + run: | |
| 41 | + convert -list font || echo "NO ERR" |
| 42 | + - name: Install Java |
| 43 | + uses: actions/setup-java@v4 |
| 44 | + with: |
| 45 | + distribution: 'temurin' |
| 46 | + java-version: | |
| 47 | + 17 |
| 48 | + - name: Enable KVM group perms |
| 49 | + run: | |
| 50 | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules |
| 51 | + sudo udevadm control --reload-rules |
| 52 | + sudo udevadm trigger --name-match=kvm |
| 53 | + - name: test java1 |
| 54 | + run: | |
| 55 | + pwd |
| 56 | + type java |
| 57 | + echo "===========1=========" |
| 58 | + java -version || exit 0 |
| 59 | + echo "===========2=========" |
| 60 | + - name: download tester |
| 61 | + shell: bash |
| 62 | + run: | |
| 63 | + curl -L https://github.com/zoff99/java_tox_tester/archive/refs/heads/master.zip -o master.zip |
| 64 | + unzip master.zip |
| 65 | + ls -al java_tox_tester-master/ |
| 66 | + java -version |
| 67 | + javac -version |
| 68 | + - name: start tester |
| 69 | + shell: bash |
| 70 | + run: | |
| 71 | + cd java_tox_tester-master/ ; ls -al ; ./do_wait_for_app.sh & |
| 72 | + - name: check disk space |
| 73 | + shell: bash |
| 74 | + run: | |
| 75 | + df -h |
| 76 | + du -hs /home/runner/work |
| 77 | + cd /home/runner/work |
| 78 | + du -s *|sort -n |
| 79 | + - name: android test |
| 80 | + timeout-minutes: 30 |
| 81 | + continue-on-error: true |
| 82 | + uses: reactivecircus/android-emulator-runner@v2 |
| 83 | + with: |
| 84 | + api-level: ${{ matrix.api-level }} |
| 85 | + profile: Nexus 6 |
| 86 | + arch: x86_64 |
| 87 | + ndk: 21.0.6113669 |
| 88 | + cmake: 3.10.2.4988404 |
| 89 | + force-avd-creation: false |
| 90 | + emulator-options: -no-snapshot-save -skin 1080x2220 -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none |
| 91 | + disable-animations: true |
| 92 | + disable-spellchecker: true |
| 93 | + script: | |
| 94 | + df -h |
| 95 | + rm -f /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/android-refimpl-app/app/witness.gradle |
| 96 | + 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 |
| 97 | + printf 'dependencyVerification {\nverify = [\n]\n}\n' > /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/android-refimpl-app/app/witness.gradle |
| 98 | + java -version |
| 99 | + cd android-refimpl-app ; ./gradlew assemble |
| 100 | + adb logcat -c || echo "NOERR" |
| 101 | + adb logcat > /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/android-refimpl-app/logcat.txt & |
| 102 | + echo 'sleep 100' > /home/runner/a.sh |
| 103 | + echo 'sleep 40' >> /home/runner/a.sh |
| 104 | + echo 'sleep 10' >> /home/runner/a.sh |
| 105 | + echo 'sleep 10' >> /home/runner/a.sh |
| 106 | + echo 'sleep 10' >> /home/runner/a.sh |
| 107 | + cat /home/runner/a.sh |
| 108 | + ls -al /home/runner/a.sh |
| 109 | + chmod u+rx /home/runner/a.sh |
| 110 | + bash /home/runner/a.sh & |
| 111 | + cd android-refimpl-app ; ./gradlew app:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=com.zoffcc.applications.trifa.JavaFriendTester || echo "NOERR" |
| 112 | + pwd |
| 113 | + adb pull /sdcard/googletest/test_outputfiles . |
| 114 | + ls -al /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/test_outputfiles/ |
| 115 | + echo "---------------" |
| 116 | + ls -al /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/test_outputfiles/*.png |
| 117 | + - name: make promo screenshots 1 |
| 118 | + run: | |
| 119 | + pwd |
| 120 | + git clone https://github.com/zoff99/android_promo_screens |
| 121 | + cd ./android_promo_screens/ |
| 122 | + ./test.sh "TRIfA" "Message your Friends and Family securely and with ease." /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/test_outputfiles/test_004b.png |
| 123 | + cp -av output.png promo_02.png |
| 124 | + mv -v promo_02.png ../promo_${{ matrix.api-level }}_02.png |
| 125 | + ./test.sh "TRIfA" "Send Messages and Files or just Call your Friends." /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/test_outputfiles/test_099.png |
| 126 | + cp -av output.png promo_03.png |
| 127 | + mv -v promo_03.png ../promo_${{ matrix.api-level }}_03.png |
| 128 | + - name: make promo screenshots 2 |
| 129 | + run: | |
| 130 | + cd ./android_promo_screens/ |
| 131 | + ./test2.sh "TRIfA" "Message your Friends and Family securely and with ease." /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/images/101.png |
| 132 | + cp -av output.png promo_101.png |
| 133 | + mv -v promo_101.png ../promo_${{ matrix.api-level }}_101.png |
| 134 | + ./test2.sh "TRIfA" "Send Messages and Files or just Call your Friends." /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/images/102.png |
| 135 | + cp -av output.png promo_102.png |
| 136 | + mv -v promo_102.png ../promo_${{ matrix.api-level }}_102.png |
| 137 | + - name: Upload to nightly release |
| 138 | + uses: ncipollo/release-action@v1 |
| 139 | + if: github.event_name == 'push' && github.ref == 'refs/heads/zoff99/dev003' |
| 140 | + with: |
| 141 | + allowUpdates: true |
| 142 | + tag: nightly |
| 143 | + omitBodyDuringUpdate: true |
| 144 | + omitNameDuringUpdate: true |
| 145 | + prerelease: true |
| 146 | + replacesArtifacts: true |
| 147 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 148 | + artifacts: "promo_${{ matrix.api-level }}_02.png,promo_${{ matrix.api-level }}_03.png,promo_${{ matrix.api-level }}_101.png,promo_${{ matrix.api-level }}_102.png" |
| 149 | + |
| 150 | + |
| 151 | + - name: put datetime on screenshots |
| 152 | + run: | |
| 153 | + cd /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/ |
| 154 | + git rev-parse --short HEAD |
| 155 | + c="$(git rev-parse --short HEAD)" |
| 156 | + cd /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/test_outputfiles/ |
| 157 | + ls -al |
| 158 | + d="$(date '+%Y-%m-%d %H:%M:%S')" |
| 159 | + convert test_004b.png -gravity SouthEast -pointsize 62 -fill white -annotate +30+30 "$d ($c)" test_004b_time.png |
| 160 | + convert test_099.png -gravity SouthEast -pointsize 62 -fill white -annotate +30+30 "$d ($c)" test_099_time.png |
| 161 | + mv test_004b_time.png test_004b.png |
| 162 | + mv test_099_time.png test_099.png |
| 163 | + - name: upload screenshots |
| 164 | + uses: actions/upload-artifact@v4 |
| 165 | + with: |
| 166 | + name: linuxscreen_${{ matrix.api-level }} |
| 167 | + path: | |
| 168 | + /home/runner/screen*.png |
| 169 | + /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/test_outputfiles/*.png |
| 170 | + - name: upload logcat output |
| 171 | + continue-on-error: true |
| 172 | + uses: actions/upload-artifact@v4 |
| 173 | + with: |
| 174 | + name: logcat_${{ matrix.api-level }} |
| 175 | + path: | |
| 176 | + /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/android-refimpl-app/logcat.txt |
| 177 | + - name: Rename artifact for nightly upload |
| 178 | + if: github.event_name == 'push' && github.ref == 'refs/heads/zoff99/dev003' |
| 179 | + run: | |
| 180 | + pwd |
| 181 | + cp -av /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/test_outputfiles/test_004b.png screen_shot_android_${{ matrix.api-level }}_02.png |
| 182 | + cp -av /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/test_outputfiles/test_099.png screen_shot_android_${{ matrix.api-level }}_03.png |
| 183 | + - name: Upload to nightly release |
| 184 | + uses: ncipollo/release-action@v1 |
| 185 | + if: github.event_name == 'push' && github.ref == 'refs/heads/zoff99/dev003' |
| 186 | + with: |
| 187 | + allowUpdates: true |
| 188 | + tag: nightly |
| 189 | + omitBodyDuringUpdate: true |
| 190 | + omitNameDuringUpdate: true |
| 191 | + prerelease: true |
| 192 | + replacesArtifacts: true |
| 193 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 194 | + artifacts: "screen_shot_android_${{ matrix.api-level }}_02.png,screen_shot_android_${{ matrix.api-level }}_03.png" |
| 195 | + |
0 commit comments