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.7 KiB
98 lines
2.7 KiB
name: Macrobenchmark + Screen Record (AVD Cached)
|
|
|
|
on:
|
|
push:
|
|
branches: [testNIA]
|
|
|
|
jobs:
|
|
macrobenchmark:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
api-level: [30]
|
|
|
|
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: 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: Restore AVD cache
|
|
uses: actions/cache@v4
|
|
id: avd-cache
|
|
with:
|
|
path: |
|
|
~/.android/avd
|
|
~/.android/adb*
|
|
key: avd-api-${{ matrix.api-level }}
|
|
|
|
- name: Create AVD snapshot (cache miss only)
|
|
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
|
|
disable-animations: true
|
|
emulator-options: >
|
|
-no-window
|
|
-noaudio
|
|
-no-boot-anim
|
|
-gpu swiftshader_indirect
|
|
script: echo "AVD 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
|
|
disable-animations: true
|
|
emulator-options: >
|
|
-no-window
|
|
-noaudio
|
|
-no-boot-anim
|
|
-gpu swiftshader_indirect
|
|
script: |
|
|
echo "Start screen recording"
|
|
adb shell screenrecord /sdcard/benchmark.mp4 &
|
|
|
|
./gradlew :benchmark:connectedDemoBenchmarkAndroidTest
|
|
|
|
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: |
|
|
**/build/outputs/benchmarkReports/**
|
|
|
|
- name: Upload screen recording
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: benchmark-video
|
|
path: benchmark.mp4
|