Skip to content

Commit ba9c7ed

Browse files
committed
refactor(ci): simplify test-e2e with api-level 29, google_apis, screenshot in script
1 parent 9297a1d commit ba9c7ed

1 file changed

Lines changed: 17 additions & 52 deletions

File tree

.github/workflows/build.yml

Lines changed: 17 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -290,19 +290,11 @@ jobs:
290290
#runs-on: "macos-12" # macOS-latest
291291
runs-on: ubicloud-standard-8
292292
env:
293-
MATRIX_E_SDK: ${{ matrix.android_emu_version }}
294-
MATRIX_AVD: ${{ matrix.android_avd }}
293+
MATRIX_E_SDK: ${{ matrix.api-level }}
295294
strategy:
296295
fail-fast: false
297-
max-parallel: 1
298296
matrix:
299-
android_avd: [Pixel_API_32_AOSP]
300-
include:
301-
# - android_avd: Pixel_API_27_AOSP
302-
# android_emu_version: 27
303-
# # # Cannot run > 27-emuLevel -_- https://github.com/actions/runner-images/issues/6527
304-
- android_avd: Pixel_API_32_AOSP
305-
android_emu_version: 32
297+
api-level: [29]
306298
steps:
307299

308300
- uses: actions/checkout@v4
@@ -335,62 +327,35 @@ jobs:
335327
distribution: 'temurin'
336328
java-version: ${{ env.JAVA_VERSION }}
337329

338-
- name: Run E2E tests
330+
- name: Run Emulator and E2E tests
339331
uses: reactivecircus/android-emulator-runner@v2
340332
timeout-minutes: 30
341333
id: test
342334
with:
343-
api-level: ${{ matrix.android_emu_version }}
335+
api-level: ${{ matrix.api-level }}
336+
target: google_apis
344337
arch: x86_64
345-
target: default
346338
ndk: ${{ env.NDK_VERSION }}
347339
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -no-snapshot-save
348340
disable-animations: true
349-
script: make test-e2e
341+
script: |
342+
make test-e2e || true
343+
adb shell screencap -p /sdcard/screenshot.png
344+
adb pull /sdcard/screenshot.png .
350345
351-
- name: Output and save logcat to file
352-
if: ${{ success() || steps.test.conclusion == 'failure'}}
353-
run: |
354-
mkdir -p mobile/build
355-
adb logcat -d > mobile/build/logcat.log
356-
adb logcat -v color &
357-
358-
- name: Screenshot
359-
if: ${{ success() || steps.test.conclusion == 'failure'}}
360-
env:
361-
SUFFIX: ${{ matrix.android_avd }}-eAPI-${{ matrix.android_emu_version }}
362-
run: |
363-
adb shell monkey -p net.activitywatch.android.debug 1
364-
sleep 10
365-
screencapture screenshots/pscreenshot-$SUFFIX.jpg
366-
$ANDROID_HOME/platform-tools/adb exec-out screencap -p > screenshots/pemulator-$SUFFIX.png
367-
ls -alh screenshots/
346+
- name: Upload screenshot
347+
uses: actions/upload-artifact@v4
348+
if: ${{ success() || steps.test.conclusion == 'failure' }}
349+
with:
350+
name: emulator-screenshot
351+
path: screenshot.png
368352

369353
- name: Upload logcat
370-
if: ${{ success() || steps.test.conclusion == 'failure'}}
354+
if: ${{ success() || steps.test.conclusion == 'failure' }}
371355
uses: actions/upload-artifact@v4
372356
with:
373357
name: logcat
374-
# mobile\build\outputs\connected_android_test_additional_output\debugAndroidTest\connected\Pixel_XL_API_32(AVD) - 12\ScreenshotTest_saveDeviceScreenBitmap.png
375-
path: |
376-
mobile/build/logcat.log
377-
#mobile/build/reports/*
378-
379-
# - name: Upload video
380-
# if: ${{ success() || steps.test.conclusion == 'failure'}}
381-
# uses: actions/upload-artifact@master
382-
# with:
383-
# name: video
384-
# path: ./*.mov # out.mov
385-
386-
- name: Upload screenshots
387-
uses: actions/upload-artifact@v4
388-
if: ${{ success() || steps.test.conclusion == 'failure'}}
389-
with:
390-
name: screenshots
391-
path: |
392-
screenshots/*
393-
**/mobile/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/*
358+
path: mobile/build/logcat.log
394359

395360
#- name: Publish Test Report
396361
# # # uses: mikepenz/action-junit-report@v3

0 commit comments

Comments
 (0)