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.
82 lines
2.6 KiB
82 lines
2.6 KiB
name: Macrobenchmark + Screen Record (Emulator API 35)
|
|
|
|
on:
|
|
push:
|
|
branches: [testNIA]
|
|
|
|
jobs:
|
|
macrobenchmark:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
|
|
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: Install system dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
# Using the verified packages for Ubuntu 24.04
|
|
sudo apt-get install -y libpulse0 libvulkan1 mesa-utils libgl1 libglx-mesa0
|
|
|
|
- name: Build benchmark APKs
|
|
run: |
|
|
./gradlew :app:assembleDemoBenchmark \
|
|
:benchmarks:assembleDemoBenchmark \
|
|
--stacktrace
|
|
|
|
- name: Run Macrobenchmarks
|
|
uses: reactivecircus/android-emulator-runner@v2
|
|
with:
|
|
api-level: 35
|
|
target: google_apis
|
|
arch: x86_64
|
|
force-avd-creation: false
|
|
disable-animations: true
|
|
emulator-options: -no-window -gpu host -no-audio -no-boot-anim
|
|
script: |
|
|
adb wait-for-device
|
|
|
|
echo "Starting screen recording..."
|
|
# Using /sdcard/ is standard for screenrecord permissions
|
|
adb shell screenrecord /sdcard/benchmark.mp4 &
|
|
|
|
echo "Running benchmarks..."
|
|
# We add the license exclusion here to prevent the GMS crash during testing
|
|
./gradlew :benchmarks:connectedDemoBenchmarkAndroidTest \
|
|
-x :app:generateDemoBenchmarkOssLicenses \
|
|
-x :benchmarks:generateDemoBenchmarkOssLicenses \
|
|
-Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.suppressErrors=EMULATOR \
|
|
|| echo "Benchmarks finished with errors, pulling data anyway..."
|
|
|
|
echo "Stopping recording..."
|
|
adb shell pkill -2 screenrecord || true
|
|
sleep 5
|
|
|
|
echo "Pulling files..."
|
|
adb pull /sdcard/benchmark.mp4 . || touch benchmark.mp4
|
|
adb logcat -d > logcat.txt || touch logcat.txt
|
|
|
|
- name: Upload Macrobenchmark Reports
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: macrobenchmark-results
|
|
path: |
|
|
**/build/outputs/**/*.json
|
|
**/build/reports/androidTests/connected/
|
|
logcat.txt
|
|
|
|
- name: Upload Screen Recording
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: benchmark-video
|
|
path: benchmark.mp4 |