Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

baseline profile ci test #559

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
54 changes: 54 additions & 0 deletions .github/workflows/baseline-profile-updater.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Baseline Profile Updater

on: pull_request

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
lfs: 'true'

- name: Set up JDK 18
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 18

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

- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm

- name: Generate baseline profiles
run: |
./gradlew :catalog:generateReleaseBaselineProfile :icons:generateBaselineProfile :illustrations:generateBaselineProfile :ui:generateBaselineProfile \
-Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=baselineprofile

- name: Check for changes
id: check_changes
run: |
if git diff --exit-code; then
echo "changes_exist=false" >> "$GITHUB_OUTPUT"
else
echo "changes_exist=true" >> "$GITHUB_OUTPUT"
fi

- name: Commit and push files
if: ${{ steps.check_changes.outputs.changes_exist == 'true' }}
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.GH_ACTION_DEPLOY_PRIVATE_KEY }}"
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
git commit -m "Baseline and startup profiles generated."
git push [email protected]:$GITHUB_REPOSITORY.git
4 changes: 4 additions & 0 deletions baselineprofile/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ android {
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = "1.8"
}

lint {
abortOnError = true
warningsAsErrors = true
Expand Down
Git LFS file not shown
Git LFS file not shown
4 changes: 2 additions & 2 deletions icons/src/androidMain/baseline-prof.txt
Git LFS file not shown
4 changes: 2 additions & 2 deletions illustrations/src/androidMain/baseline-prof.txt
Git LFS file not shown
4 changes: 2 additions & 2 deletions ui/src/androidMain/baseline-prof.txt
Git LFS file not shown
Loading