Skip to content

Instantly share code, notes, and snippets.

@skydoves
Last active November 10, 2023 04:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skydoves/9d8538b7a56624e28046fde696363c64 to your computer and use it in GitHub Desktop.
Save skydoves/9d8538b7a56624e28046fde696363c64 to your computer and use it in GitHub Desktop.
baseline_github_actions
name: baseline-profiles
run-name: ${{ github.actor }} requested a workflow
# This should be a manual trigger so this actions gets executed every time make a new pull request.
# Change this event to what suits your project best.
# Read more at https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
on:
workflow_dispatch:
jobs:
generate-baseline-profiles:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/gradle-build-action@v2.9.0
- name: Grant Permissions to gradlew
run: chmod +x gradlew
- name: Build app and benchmark
run: ./gradlew :app:assembleBenchmark # change the 'app' with your app module's name
- name: Clean Managed Devices
run: ./gradlew cleanManagedDevices --unused-only
# Generates Baseline Profile
- name: Generate Baseline Profile
run: ./gradlew generateBaselineProfile -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" -Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=BaselineProfile -Pandroid.experimental.testOptions.managedDevices.setupTimeoutMinutes=20 -Dorg.gradle.workers.max=4
# Create Pull Request
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: "Generate baseline profiles"
title: "Generate baseline profiles"
delete-branch: true
branch: actions/baseline-profiles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment