Skip to content

baseline-profiles

baseline-profiles #8

name: NightlyBaselineProfiles
on:
schedule:
- cron: '42 4 * * *'
workflow_dispatch:
jobs:
baseline_profiles:
name: "Generate Baseline Profiles"
runs-on: ubuntu-latest
permissions:
contents: write
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
- name: Setup Gradle
uses: gradle/[email protected]
- name: Grant Permissions to gradlew
run: chmod +x gradlew
- name: Add Local Properties
env:
API_KEY: ${{ secrets.SENTRY_DSN }}
DATA_STORE_KEY: ${{ secrets.SENTRY_DSN }}
SOPT_DEV_OPERATION_BASE_URL: ${{ secrets.SOPT_DEV_OPERATION_BASE_URL }}
SOPT_OPERATION_BASE_URL: ${{ secrets.SOPT_OPERATION_BASE_URL }}
DEV_API: ${{ secrets.SENTRY_DSN }}
NEW_API: ${{ secrets.SENTRY_DSN }}
KEY_ALIAS: ${{ secrets.SENTRY_DSN }}
KEY_PASSWORD: ${{ secrets.SENTRY_DSN }}
STORE_PASSWORD: ${{ secrets.SENTRY_DSN }}
DEV_AMPLITUDE_KEY: ${{ secrets.SENTRY_DSN }}
AMPLITUDE_KEY: ${{ secrets.SENTRY_DSN }}
POKE_DATA_STORE_KEY: ${{ secrets.SENTRY_DSN }}
run: |
echo apiKey=\"$API_KEY\" >> ./local.properties
echo dataStoreKey=\"$DATA_STORE_KEY\" >> ./local.properties
echo devOperationApi=\"$SOPT_DEV_OPERATION_BASE_URL\" >> ./local.properties
echo operationApi=\"$SOPT_OPERATION_BASE_URL\" >> ./local.properties
echo devApi=\"$DEV_API\" >> ./local.properties
echo newApi=\"$NEW_API\" >> ./local.properties
echo keyAlias=\"KEY_ALIAS\" >> ./local.properties
echo keyPassword=\"KEY_PASSWORD\" >> ./local.properties
echo storePassword=\"STORE_PASSWORD\" >> ./local.properties
echo devAmplitudeKey=\"$DEV_AMPLITUDE_KEY\" >> ./local.properties
echo amplitudeKey=\"$AMPLITUDE_KEY\" >> ./local.properties
echo pokeDataStoreKey=\"$POKE_DATA_STORE_KEY\" >> ./local.properties
- name: Access Firebase Service
run: echo '${{ secrets.GOOGLE_SERVICES_JSON }}' > ./app/google-services.json
- name: Generate Keystore File
run: |
echo ${{ secrets.KEYSTORE }} > ./keystore/keystore.b64
base64 -d -i ./keystore/keystore.b64 > ./keystore/keystore.jks
- 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
- 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
- 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