You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
2.0 KiB
67 lines
2.0 KiB
name: Benchmark on Emulator
|
|
|
|
on:
|
|
push:
|
|
branches: [testNIA]
|
|
|
|
jobs:
|
|
benchmark-android:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 45
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: '17'
|
|
cache: 'gradle'
|
|
|
|
- name: Build Benchmark APKs
|
|
run: |
|
|
./gradlew :app:assembleDemoBenchmark :benchmarks:assembleDemoBenchmark
|
|
|
|
- name: AVD Cache
|
|
uses: actions/cache@v4
|
|
id: avd-cache
|
|
with:
|
|
path: |
|
|
~/.android/avd/*
|
|
~/.android/adb*
|
|
key: avd-33-x86_64-google_apis
|
|
|
|
- name: Run Benchmarks & Record Video
|
|
uses: reactivecircus/android-emulator-runner@v2
|
|
with:
|
|
api-level: 33
|
|
target: google_apis
|
|
arch: x86_64
|
|
force-avd-creation: false
|
|
# We use swiftshader_indirect to avoid the "device not found" crash
|
|
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim
|
|
disable-animations: true
|
|
script: |
|
|
# 1. Start recording
|
|
adb shell screenrecord --time-limit 180 /sdcard/benchmark_video.mp4 &
|
|
|
|
# 2. Run the tests (Using the APKs we built in STEP A)
|
|
./gradlew :benchmarks:connectedDemoBenchmarkAndroidTest \
|
|
-Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.suppressErrors=EMULATOR
|
|
|
|
# 3. Finalize video
|
|
sleep 2
|
|
adb shell pkill -2 screenrecord || true
|
|
sleep 5
|
|
adb pull /sdcard/benchmark_video.mp4 benchmark_video.mp4
|
|
|
|
- name: Upload Artifacts
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: benchmark-package
|
|
path: |
|
|
benchmark_video.mp4
|
|
benchmarks/build/outputs/connected_android_test_additional_output/ |