Use google_atd #3
Workflow file for this run
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: Baseline profile generation | |
on: | |
push: | |
# every monday at 00:00 | |
schedule: | |
- cron: '0 0 * * 1' | |
workflow_dispatch: | |
jobs: | |
baseline-profile: | |
runs-on: macos-latest | |
timeout-minutes: 45 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- uses: gradle/gradle-build-action@v2 | |
with: | |
# Disable caching. This action is very different to the normal build action, and we | |
# don't want to spoil the cache which is used for the 'build' action. | |
cache-read-only: true | |
- name: AVD cache | |
uses: actions/cache@v3 | |
id: avd-cache | |
with: | |
path: | | |
~/.android/avd/* | |
~/.android/adb* | |
key: avd-33 | |
- name: Create AVD and generate snapshot for caching | |
if: steps.avd-cache.outputs.cache-hit != 'true' | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 33 | |
arch: x86_64 | |
target: google_atd | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: false | |
script: echo "Generated AVD snapshot for caching." | |
- name: Generate baseline profile | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 33 | |
force-avd-creation: false | |
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: true | |
script: ./gradlew generateLawnWithQuickstepReleaseBaselineProfile | |
# If we're on main branch, copy over the baseline profile and | |
# commit it to the repository (if changed) | |
- name: Commit baseline profile into main | |
if: github.ref == 'refs/heads/13-dev' | |
run: | | |
# Pull down any changes which may have been committed while this workflow has been running | |
git pull | |
# If the baseline profile has changed, commit it | |
if [[ $(git diff --stat lawnWithQuickstepRelease/generated/baselineProfiles/baseline-prof.txt) != '' ]]; then | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add android-app/app/src/main/baseline-prof.txt | |
git commit -m "Update app baseline profile" && git push | |
fi |