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.
97 lines
2.9 KiB
97 lines
2.9 KiB
name: Macrobenchmark + Screen Record (Emulator API 35)
|
|
|
|
on:
|
|
push:
|
|
branches: [testNIA]
|
|
|
|
jobs:
|
|
macrobenchmark:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
api-level: [35]
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Enable KVM for emulator
|
|
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
|
|
|
|
- name: Install emulator system dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libpulse0 libvulkan1 mesa-utils libgl1 libglx-mesa0 libgl1-mesa-dri
|
|
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
distribution: zulu
|
|
java-version: 17
|
|
cache: gradle
|
|
|
|
- name: Build benchmark APKs
|
|
run: |
|
|
./gradlew :app:assembleDemoBenchmark \
|
|
:benchmark:assembleDemoBenchmark
|
|
|
|
- name: Cache AVD
|
|
uses: actions/cache@v4
|
|
id: avd-cache
|
|
with:
|
|
path: |
|
|
~/.android/avd/*
|
|
~/.android/adb*
|
|
key: avd-${{ matrix.api-level }}
|
|
|
|
- name: Create emulator snapshot (only if not cached)
|
|
if: steps.avd-cache.outputs.cache-hit != 'true'
|
|
uses: reactivecircus/android-emulator-runner@v2
|
|
with:
|
|
api-level: ${{ matrix.api-level }}
|
|
target: google_apis
|
|
arch: x86_64
|
|
force-avd-creation: false
|
|
emulator-options: -no-window -gpu host
|
|
disable-animations: true
|
|
script: echo "Snapshot created."
|
|
|
|
- name: Run macrobenchmark + screen record
|
|
uses: reactivecircus/android-emulator-runner@v2
|
|
with:
|
|
api-level: ${{ matrix.api-level }}
|
|
target: google_apis
|
|
arch: x86_64
|
|
force-avd-creation: false
|
|
emulator-options: -no-snapshot-save -no-window -gpu host
|
|
disable-animations: true
|
|
script: |
|
|
echo "Starting screen recording"
|
|
adb shell screenrecord /sdcard/benchmark.mp4 &
|
|
|
|
# Run macrobenchmark tests (suppress emulator error, non-blocking)
|
|
./gradlew :benchmark:connectedDemoBenchmarkAndroidTest \
|
|
-Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.suppressErrors=EMULATOR \
|
|
|| true
|
|
|
|
adb shell pkill -INT screenrecord || true
|
|
sleep 3
|
|
adb pull /sdcard/benchmark.mp4 benchmark.mp4
|
|
|
|
- name: Upload macrobenchmark reports
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: macrobenchmark-reports
|
|
path: benchmarks/build/reports/androidTests/connected/
|
|
|
|
- name: Upload screen recording
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: benchmark-video
|
|
path: benchmark.mp4
|