Update dependency com.google.android.horologist:horologist-compose-la… #725
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: Update baseline profile | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- 'app/src/androidMain/baseline-prof.txt' # don't recursively update baseline profile | |
workflow_dispatch: | |
jobs: | |
validate-wrapper: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Validate Gradle Wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
update-baseline-profile: | |
needs: validate-wrapper | |
runs-on: macos-latest # for hardware acceleration | |
timeout-minutes: 60 | |
concurrency: | |
group: baseline-profile-update-baseline-profile | |
cancel-in-progress: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
token: ${{ secrets.PAT }} | |
- name: Copy ci-gradle.properties | |
run: | | |
mkdir -p ~/.gradle | |
cp .github/ci-gradle.properties ~/.gradle/gradle.properties | |
- name: Cache AVD | |
uses: actions/cache@v3 | |
id: avd-cache | |
with: | |
path: | | |
~/.android/avd/* | |
key: v2-${{ runner.os }}-gmd-pixel2-31-aosp | |
- name: Configure JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Accept license | |
run: echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_SDK_ROOT/licenses/android-sdk-preview-license" | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Generate baseline profile for app | |
run: | | |
# generate the baseline profile, with one retry attempt | |
generate_profile () { ./gradlew :app-baseline-profile-generator:aosppixel2api30Check --no-parallel -Dorg.gradle.workers.max=2 --stacktrace -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" -Pcom.alexvanyo.composelife.generateBaselineProfile=true; } | |
(echo "==== Attempt 1 ====" && generate_profile) || (echo "==== Attempt 2 ====" && generate_profile) || (echo "==== Both attempts failed ====" && exit 1) | |
- name: Copy baseline profile to app | |
run: cp app-baseline-profile-generator/build/intermediates/managed_device_android_test_additional_output/benchmark/aosppixel2api30BenchmarkAndroidTest/BaselineProfileGenerator_startup-baseline-prof.txt app/src/androidMain/baseline-prof.txt | |
- name: Generate baseline profile for wear | |
if: false # TODO: https://github.com/alexvanyo/composelife/issues/1159 | |
run: | | |
# generate the baseline profile, with one retry attempt | |
generate_profile () { ./gradlew :wear-baseline-profile-generator:wearwearoslargeroundapi28Check --no-parallel -Dorg.gradle.workers.max=2 --stacktrace -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" -Pcom.alexvanyo.composelife.generateBaselineProfile=true; } | |
(echo "==== Attempt 1 ====" && generate_profile) || (echo "==== Attempt 2 ====" && generate_profile) || (echo "==== Both attempts failed ====" && exit 1) | |
- name: Copy baseline profile to wear | |
if: false # TODO: https://github.com/alexvanyo/composelife/issues/1159 | |
run: cp wear-baseline-profile-generator/build/intermediates/managed_device_android_test_additional_output/benchmark/wearwearoslargeroundapi28/BaselineProfileGenerator_startup-baseline-prof.txt wear/src/androidMain/baseline-prof.txt | |
- name: Auto-commit changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: Auto update app baseline profile | |
push_options: --force-with-lease |