Skip to content

Commit

Permalink
Add new baseline profile plugin (slackhq#623)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacSweers authored May 18, 2023
1 parent 3bc40b2 commit c5ea6da
Show file tree
Hide file tree
Showing 31 changed files with 9,485 additions and 16,667 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/update-baseline-profiles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: "Update Baseline Profiles"

on:
workflow_dispatch:
# Always run on PRs if this file was modified! We won't PR changes if we modify the file though
pull_request:
paths:
- '.github/workflows/update-baseline-profiles.yml'

concurrency:
group: 'ci-${{ github.event.merge_group.head_ref || github.head_ref }}-${{ github.workflow }}'
cancel-in-progress: true

jobs:
update-baseline-profiles:
runs-on: macOS-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
lfs: 'true'

- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1

- name: Install JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '19'

- name: Set up Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
cache-read-only: false

- name: Generate baseline profiles
run: ./scripts/update-baseline-profiles.sh

- name: Create Pull Request
if: github.event_name == 'workflow_dispatch'
id: createpr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.SLACKHQ_MBR_GITHUB_TOKEN }}
commit-message: 'Update baseline profiles'
committer: OSS-Bot <[email protected]>
author: OSS-Bot <[email protected]>
title: 'Update baseline profiles'
body: 'Updates baseline profiles'
reviewers: ${{ github.actor }}
branch-suffix: timestamp
branch: bot/update-baseline-profiles
9 changes: 9 additions & 0 deletions backstack/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
kotlin("multiplatform")
alias(libs.plugins.compose)
id("com.vanniktech.maven.publish")
alias(libs.plugins.baselineprofile)
}

kotlin {
Expand Down Expand Up @@ -49,3 +50,11 @@ kotlin {
android { namespace = "com.slack.circuit.backstack" }

androidComponents { beforeVariants { variant -> variant.enableAndroidTest = false } }

baselineProfile {
// https://issuetracker.google.com/issues/282127523
baselineProfileOutputDir = "../../src/androidMain/generated/baselineProfiles"
filter { include("com.slack.circuit.backstack.**") }
}

dependencies { baselineProfile(projects.samples.star.benchmark) }
162 changes: 0 additions & 162 deletions backstack/src/androidMain/baseline-prof.txt

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions circuit-foundation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ plugins {
kotlin("multiplatform")
alias(libs.plugins.compose)
id("com.vanniktech.maven.publish")
alias(libs.plugins.baselineprofile)
}

kotlin {
Expand Down Expand Up @@ -70,3 +71,11 @@ tasks
android { namespace = "com.slack.circuit.foundation" }

androidComponents { beforeVariants { variant -> variant.enableAndroidTest = false } }

baselineProfile {
// https://issuetracker.google.com/issues/282127523
baselineProfileOutputDir = "../../src/androidMain/generated/baselineProfiles"
filter { include("com.slack.circuit.foundation.**") }
}

dependencies { baselineProfile(projects.samples.star.benchmark) }
Loading

0 comments on commit c5ea6da

Please sign in to comment.