Skip to content

Generate Baseline Profile #11

Generate Baseline Profile

Generate Baseline Profile #11

name: Generate Baseline Profile
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setting up project
uses: ./.github/actions/setup
#
# - name: Install GMD image for baseline profile generation
# run: yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager "system-images;android-34;aosp_atd;x86_64"
- name: Accept Android licenses
run: yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager --licenses || true
# Now use reactivecircus/android-emulator-runner to spin up an emulator and run our
# baseline profile generator. We need to manually pull the baseline profiles off the
# emulator when using the GA runner
- name: Run benchmark
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
target: google_apis
arch: x86_64
profile: Nexus 6
script: |
./gradlew :app:generateFreeReleaseBaselineProfile
#
# - name: Setup GMD
# run: ./gradlew :baselineprofile:pixel6Api34Setup
# --info
# -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
# -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
#
# - name: Build all build type and flavor permutations including baseline profiles
# run: ./gradlew :app:assemble
# -Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=baselineprofile
# -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
# -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
#
# - name: Generate profile
# run: ./gradlew :app:generateFreeReleaseBaselineProfile
# -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
# Now use reactivecircus/android-emulator-runner to spin up an emulator and run our
# baseline profile generator. We need to manually pull the baseline profiles off the
# emulator when using the GA runner
# - name: Run benchmark
# id: build
# run: |
# # Run our benchmark, enabling only tests using BaselineProfile
# ./gradlew pixel6Api34ProBenchmarkReleaseAndroidTest -Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=BaselineProfile
# # Need to manually pull the generated profiles from the emulator
# adb pull /sdcard/Android/media/app.tivi.benchmark benchmark/build/outputs/baseline-prof/
# Upload the entire generated folder and attach it to the CI run
- name: Attach baseline profile
uses: actions/upload-artifact@v4
with:
name: Baseline profile output
path: app/src/freeRelease/generated/baselineProfiles/