Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d90421f
chore(benchmark): capture current baseline and make benchmark profile…
yamilmedina May 13, 2026
2fc226b
chore(benchmark): convert benchmark into test producer module and par…
yamilmedina May 13, 2026
865676a
chore: apply baseline plugin for app usage and generate new baseline
yamilmedina May 13, 2026
328f715
chore: add baseline worflow generation
yamilmedina May 19, 2026
855f6ab
chore: add baseline worflow generation, now with disposable usres
yamilmedina May 19, 2026
8114412
chore: add baseline worflow generation, now with disposable usres
yamilmedina May 19, 2026
ac51ec2
chore: testing workflow
yamilmedina May 19, 2026
abd2e49
chore: testing workflow
yamilmedina May 19, 2026
2838ad8
chore: testing workflow
yamilmedina May 19, 2026
adb9586
chore: testing workflow
yamilmedina May 19, 2026
39eb9ff
Merge branch 'develop' into perf/baseline-apply-torelease
yamilmedina May 19, 2026
5d2b446
Merge branch 'perf/baseline-apply-torelease' into perf/ci-scheduled-runs
yamilmedina May 19, 2026
1737625
chore: testing workflow
yamilmedina May 19, 2026
9d3f2de
chore: testing workflow
yamilmedina May 19, 2026
9dff114
chore: testing workflow simplification
yamilmedina May 19, 2026
b0da263
Merge branch 'develop' into perf/baseline-apply-torelease
yamilmedina May 20, 2026
ec1e6d5
Merge branch 'perf/baseline-apply-torelease' into perf/ci-scheduled-runs
yamilmedina May 20, 2026
19dab91
chore: comments addressed
yamilmedina May 20, 2026
0714083
Merge branch 'perf/baseline-apply-torelease' into perf/ci-scheduled-runs
yamilmedina May 20, 2026
675a6fa
ci: change pr creation strategy due to runner restrictions
yamilmedina May 20, 2026
fdc372d
Merge branch 'develop' into perf/ci-scheduled-runs
yamilmedina May 20, 2026
7112c6c
removing todoes
yamilmedina May 20, 2026
85ab52b
removing todoes
yamilmedina May 20, 2026
8a2ad3c
removing todoes
yamilmedina May 20, 2026
4000873
removing todoes
yamilmedina May 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 134 additions & 0 deletions .github/workflows/generate-baseline-profile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: "Generate Baseline Profile"

on:
workflow_dispatch:
schedule:
- cron: "0 2 * * 0"
push:
branches:
- 'perf/ci-scheduled-runs'

permissions:
contents: write
pull-requests: write

concurrency:
group: generate-baseline-profile
cancel-in-progress: false

env:
GITHUB_TOKEN: ${{ secrets.ANDROID_BOB_GH_TOKEN }}
BASE_BRANCH: develop
REFRESH_BRANCH: chore/baseline-profile-refresh
OP_VAULT: "Test Automation"
TARGET_PACKAGE: com.wire

jobs:
generate:
name: Generate baseline profile (prod compatrelease)
runs-on:
- self-hosted
- Linux
- X64
- office
- android-qa
timeout-minutes: 90

defaults:
run:
shell: bash

steps:
# TODO: Revert to `ref: ${{ env.BASE_BRANCH }}` once the baseline profile setup
# (baselineprofile plugin, benchmark module conversion) is merged to develop.
# Using github.ref allows testing the workflow on the feature branch before merge.
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ github.ref }}
clean: true
fetch-depth: 0
submodules: recursive

- name: Set up Java 21
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "21"
cache: gradle

- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v6

- name: Set up Android SDK
uses: android-actions/setup-android@v4

- name: Install 1Password CLI
uses: 1password/install-cli-action@v3

- name: Fetch runtime secrets
run: OP_SERVICE_ACCOUNT_TOKEN="${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}" bash scripts/qa_android_ui_tests/execution_setup.sh fetch-runtime-secrets

# Baseline profile generation doesn't need production signing.
# The test APK is installed via adb and never distributed.
# ENABLE_SIGNING=FALSE makes both release and compatrelease use debug signing.
- name: Disable production signing
run: echo "ENABLE_SIGNING=FALSE" >> "$GITHUB_ENV"

- name: Verify at least one device connected
run: |
adb devices
DEVICE_COUNT="$(adb devices | awk '$2 == "device" { count++ } END { print count + 0 }')"
test "$DEVICE_COUNT" -ge 1

- name: Capture device metadata
id: device
run: |
echo "model=$(adb shell getprop ro.product.model | tr -d '\r')" >> "$GITHUB_OUTPUT"
echo "sdk=$(adb shell getprop ro.build.version.sdk | tr -d '\r')" >> "$GITHUB_OUTPUT"

- name: Generate baseline + startup profile
run: |
./gradlew :app:generateProdCompatreleaseBaselineProfile \
-Pandroid.testInstrumentationRunnerArguments.class=com.wire.benchmark.BaselineGenerator \
-Pandroid.testInstrumentationRunnerArguments.BACKEND_NAME="STAGING" \
-Pandroid.testInstrumentationRunnerArguments.TARGET_PACKAGE="$TARGET_PACKAGE" \
--no-daemon \
--no-configuration-cache

mkdir -p app/src/main
cp app/src/prodCompatrelease/generated/baselineProfiles/baseline-prof.txt app/src/main/baseline-prof.txt
cp app/src/prodCompatrelease/generated/baselineProfiles/startup-prof.txt app/src/main/startup-prof.txt

- name: Verify generated profiles
run: |
test -s app/src/main/baseline-prof.txt
test -s app/src/main/startup-prof.txt

- name: Upload generated profiles
uses: actions/upload-artifact@v7
with:
name: baseline-profile-${{ github.run_id }}
path: |
app/src/prodCompatrelease/generated/baselineProfiles/*
if-no-files-found: error

- name: Create or update baseline profile PR
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.ANDROID_BOB_GH_TOKEN }}
branch: ${{ env.REFRESH_BRANCH }}
base: ${{ env.BASE_BRANCH }}
title: "chore: refresh baseline profile"
commit-message: "chore: refresh baseline profile"
body: |
Auto-generated by [.github/workflows/generate-baseline-profile.yml](https://github.com/${{ github.repository }}/blob/${{ env.BASE_BRANCH }}/.github/workflows/generate-baseline-profile.yml).

Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
Device: ${{ steps.device.outputs.model }} (SDK ${{ steps.device.outputs.sdk }})
labels: |
performance
add-paths: |
app/src/main/baseline-prof.txt
app/src/main/startup-prof.txt
delete-branch: false
9 changes: 9 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ plugins {
id(BuildPlugins.kotlinParcelize)
id(BuildPlugins.junit5)
id(libs.plugins.wire.hilt.get().pluginId)
alias(libs.plugins.androidx.baselineprofile)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.ksp)
alias(libs.plugins.compose.compiler)
Expand Down Expand Up @@ -170,6 +171,13 @@ android {
}
}

baselineProfile {
mergeIntoMain = false
saveInSrc = true
automaticGenerationDuringBuild = false
dexLayoutOptimization = true
}

ksp {
arg("compose-destinations.moduleName", "app")
}
Expand Down Expand Up @@ -267,6 +275,7 @@ dependencies {
implementation(libs.androidx.paging3Compose)

implementation(libs.androidx.profile.installer)
"baselineProfile"(project(":benchmark"))

// Compose iterative code, layout inspector, etc.
debugImplementation(libs.compose.ui.tooling)
Expand Down
Loading
Loading