Generate Baseline Profile #53
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate Baseline Profile | |
on: | |
workflow_dispatch: | |
workflow_call: | |
secrets: | |
token: | |
required: true | |
schedule: | |
- cron: '0 3 * * *' | |
permissions: | |
contents: write | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Enable KVM group perms | |
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: Checkout Branch | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Checkout Android SDK Benchmark | |
uses: actions/checkout@v4 | |
with: | |
repository: embrace-io/android-sdk-benchmark | |
ref: main | |
path: ./android-sdk-benchmark | |
token: ${{ secrets.GH_ANDROID_SDK_TOKEN || secrets.token }} # NOTE: read android-sdk-benchmark | |
- name: Clean Managed Devices | |
working-directory: android-sdk-benchmark | |
run: ./gradlew cleanManagedDevices --unused-only | |
- name: Generate Baseline Profile | |
working-directory: android-sdk-benchmark | |
run: ./gradlew :macrobenchmark:pixel6Api34BaselineProfileAndroidTest | |
-Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=BaselineProfile | |
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" | |
-Pandroid.experimental.testOptions.managedDevices.maxConcurrentDevices=1 | |
# Sets the Baseline Profile on its proper place so it gets correctly bundled into Play Store | |
- name: Move & Rename Baseline Profiles | |
run: cat android-sdk-benchmark/macrobenchmark/build/outputs/managed_device_android_test_additional_output/baselineprofile/pixel6Api34/BaselineProfileGenerator_startup-baseline-prof.txt | |
| grep '^[^[]*io/embrace/android/embracesdk' > embrace-android-sdk/src/main/baseline-prof.txt | |
# Commits the generated Baseline Profile to your origin/remote | |
- name: Commit Baseline Profiles | |
run: | | |
git config --global user.name 'embrace-ci[bot]' | |
git config --global user.email '[email protected]' | |
git add embrace-android-sdk/src/main/baseline-prof.txt | |
git commit -m "Generate baseline profiles" | |
git push |