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.
98 lines
2.8 KiB
98 lines
2.8 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
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Enable KVM
|
|
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 dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libpulse0
|
|
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
distribution: zulu
|
|
java-version: 17
|
|
cache: gradle
|
|
|
|
- name: Build benchmark variants
|
|
run: |
|
|
./gradlew \
|
|
:app:assembleDemoBenchmark \
|
|
:benchmark:assembleDemoBenchmark
|
|
|
|
- name: AVD cache
|
|
uses: actions/cache@v4
|
|
id: avd-cache
|
|
with:
|
|
path: |
|
|
~/.android/avd/*
|
|
~/.android/adb*
|
|
key: avd-${{ matrix.api-level }}
|
|
|
|
- name: Create AVD snapshot (only on cache miss)
|
|
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 "Start screen recording"
|
|
adb shell screenrecord /sdcard/benchmark.mp4 &
|
|
|
|
# Run macrobenchmarks (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 benchmark 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
|