Remove API<18 screenshot method, which is gone in c #154
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test.yml | |
# | |
# Copyright (C) 2022 - 2024 ViliusSutkus89.com | |
# | |
# Documenter is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License version 3, | |
# as published by the Free Software Foundation. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
# GNU General Public License for more details. | |
# | |
# You should have received a copy of the GNU General Public License | |
# along with this program. If not, see <https://www.gnu.org/licenses/>. | |
name: test | |
on: | |
workflow_dispatch: | |
push: | |
paths-ignore: | |
- '**.md' | |
- '.github/**' | |
- '!.github/workflows/test.yml' | |
- '!.github/workflows/testInner.yml' | |
permissions: | |
actions: none | |
checks: none | |
contents: none | |
deployments: none | |
issues: none | |
packages: none | |
pull-requests: none | |
repository-projects: none | |
security-events: none | |
statuses: none | |
env: | |
applicationId: com.viliussutkus89.documenter.debug | |
jobs: | |
releaseBuild: | |
if: "!contains(github.event.head_commit.message, '[SkipCI]')" | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Generate ephemeral keystore | |
run: keytool -genkey -noprompt -alias alias1 -dname "CN=$applicationId.ephemeral, OU=EphemeralSignatures, O=ViliusSutkus89.com, L=Kaunas, S=Kaunas, C=LT" -keystore app/$applicationId.ephemeral.jks -keypass 123456 -keyalg RSA -keysize 4096 -validity 1 -storepass 123456 | |
- run: ./gradlew assembleRelease bundleRelease lintRelease -Ptest_build | |
env: | |
SIGNING_KEYFILE: ${{env.applicationId}}.ephemeral.jks | |
SIGNING_PASS: 123456 | |
SIGNING_ALIAS: alias1 | |
- name: artifact release builds | |
uses: actions/upload-artifact@v4 | |
with: | |
name: APKs | |
path: | | |
app/build/outputs/apk/release/*.apk | |
app/build/outputs/bundle/release/app-release.aab | |
if-no-files-found: error | |
- name: Artifact lint report | |
uses: actions/upload-artifact@v4 | |
with: | |
path: app/build/reports/lint-results-release.html | |
name: lintResults | |
if-no-files-found: error | |
- name: verify that database schema is unchanged | |
run: diff <(git status app/schemas --short) <(echo -n "") | |
emulator: | |
runs-on: ubuntu-22.04 | |
name: android-${{ matrix.emulator.api_level }} on ${{ matrix.emulator.arch }} (${{ matrix.emulator.api_type_target }}) | |
needs: releaseBuild | |
strategy: | |
fail-fast: false | |
matrix: | |
emulator: | |
- {'api_level': 34, 'api_type_target': 'aosp_atd', 'arch': 'x86_64'} | |
- {'api_level': 33, 'api_type_target': 'aosp_atd', 'arch': 'x86_64'} | |
- {'api_level': 32, 'api_type_target': 'aosp_atd', 'arch': 'x86_64'} | |
- {'api_level': 31, 'api_type_target': 'aosp_atd', 'arch': 'x86_64'} | |
- {'api_level': 30, 'api_type_target': 'aosp_atd', 'arch': 'x86_64'} | |
- {'api_level': 30, 'api_type_target': 'aosp_atd', 'arch': 'x86'} | |
- {'api_level': 29, 'api_type_target': 'default', 'arch': 'x86_64'} | |
- {'api_level': 29, 'api_type_target': 'default', 'arch': 'x86'} | |
- {'api_level': 28, 'api_type_target': 'default', 'arch': 'x86_64'} | |
- {'api_level': 28, 'api_type_target': 'default', 'arch': 'x86'} | |
- {'api_level': 27, 'api_type_target': 'default', 'arch': 'x86_64'} | |
- {'api_level': 27, 'api_type_target': 'default', 'arch': 'x86'} | |
# system-images;android-26;default;x86 and x86_64 don't have system webview installed | |
# Skip them intentionally | |
# - {'api_level': 26, 'api_type_target': 'default', 'arch': 'x86_64'} | |
# - {'api_level': 26, 'api_type_target': 'default', 'arch': 'x86'} | |
- {'api_level': 25, 'api_type_target': 'default', 'arch': 'x86_64'} | |
- {'api_level': 25, 'api_type_target': 'default', 'arch': 'x86'} | |
- {'api_level': 24, 'api_type_target': 'default', 'arch': 'x86_64'} | |
- {'api_level': 24, 'api_type_target': 'default', 'arch': 'x86'} | |
- {'api_level': 23, 'api_type_target': 'default', 'arch': 'x86_64'} | |
- {'api_level': 23, 'api_type_target': 'default', 'arch': 'x86'} | |
- {'api_level': 22, 'api_type_target': 'default', 'arch': 'x86_64'} | |
- {'api_level': 22, 'api_type_target': 'default', 'arch': 'x86'} | |
- {'api_level': 21, 'api_type_target': 'default', 'arch': 'x86_64'} | |
- {'api_level': 21, 'api_type_target': 'default', 'arch': 'x86'} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- uses: android-actions/setup-android@v3 | |
- name: setup python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- run: pip3 install adbPullAs | |
- 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 | |
- uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-snapshot-save | |
sdcard-path-or-size: 1G | |
disk-size: 8G | |
api-level: ${{ matrix.emulator.api_level }} | |
arch: ${{ matrix.emulator.arch }} | |
target: ${{ matrix.emulator.api_type_target }} | |
script: | | |
mkdir -p testResults/screenshots | |
adb logcat > testResults/logcat.txt & | |
adb shell screencap /data/local/tmp/beforeTests.png | |
adb pull /data/local/tmp/beforeTests.png testResults/screenshots/ | |
./gradlew connectedCheck || touch sorry_but_tests_are_failing | |
adb pull /sdcard/Pictures/screenshots testResults/ || true | |
adbPullAs $applicationId /data/data/$applicationId/cache/TestScreenshots /data/user/0/$applicationId/cache/TestScreenshots /sdcard/Android/data/$applicationId/cache/TestScreenshots testResults/ || true | |
adb shell screencap /data/local/tmp/afterTests.png | |
adb pull /data/local/tmp/afterTests.png testResults/screenshots/ | |
mv app/build/reports/androidTests/connected testResults/ | |
mv app/build/outputs/androidTest-results testResults/ | |
test ! -f sorry_but_tests_are_failing | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: testResults-${{ matrix.emulator.api_level }}-${{ matrix.emulator.arch }}-${{ matrix.emulator.api_type_target }} | |
path: testResults | |
if-no-files-found: error |