Skip to content

Commit

Permalink
[CI] Update testsuite, use ubuntu-22.04
Browse files Browse the repository at this point in the history
  • Loading branch information
ViliusSutkus89 committed Jul 14, 2024
1 parent d9a217b commit 61dc0d3
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 106 deletions.
114 changes: 81 additions & 33 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,40 +78,88 @@ jobs:
- name: verify that database schema is unchanged
run: diff <(git status app/schemas --short) <(echo -n "")

instrumentedTests-aosp_atd-target:
needs: releaseBuild
name: android-${{ matrix.api-level }} ${{ matrix.arch }} ${{ matrix.api-type-target }}
strategy:
fail-fast: false
matrix:
api-level: [34, 33, 32, 31, 30]
arch: [x86_64]
api-type-target: [aosp_atd]
include:
- api-level: 30
arch: x86
api-type-target: aosp_atd
uses: ./.github/workflows/testInner.yml
with:
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.arch }}
api-type-target: ${{ matrix.api-type-target }}
applicationId: $applicationId

instrumentedTests-default-target:
emulator:
runs-on: ubuntu-22.04
name: android-${{ matrix.emulator.api_level }} on ${{ matrix.emulator.arch }} (${{ matrix.emulator.api_type_target }})
needs: releaseBuild
name: android-${{ matrix.api-level }} ${{ matrix.arch }} ${{ matrix.api-type-target }}
strategy:
fail-fast: false
matrix:
# system-images;android-26;default;x86 and x86_64 don't have system webview installed
# Skip them intentionally
api-level: [29, 28, 27, 25, 24, 23, 22, 21]
arch: [x86_64, x86]
api-type-target: [default]
uses: ./.github/workflows/testInner.yml
with:
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.arch }}
api-type-target: ${{ matrix.api-type-target }}
applicationId: $applicationId
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

# @TODO: remove --break-system-packages once python is sorted
- run: pip3 install adbPullAs --break-system-packages

- 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
73 changes: 0 additions & 73 deletions .github/workflows/testInner.yml

This file was deleted.

0 comments on commit 61dc0d3

Please sign in to comment.