-
-
Notifications
You must be signed in to change notification settings - Fork 35
73 lines (62 loc) · 2.47 KB
/
baseline-profile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Baseline profile generation
on:
push:
branches:
- main
paths-ignore:
- 'haze/src/androidMain/generated/baselineProfiles/baseline-prof.txt' # don't recursively update baseline profile
workflow_dispatch:
pull_request:
paths:
- 'internal/baseline-profile/**'
jobs:
baseline-profile:
runs-on: macos-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 20
- uses: gradle/gradle-build-action@v2
# This allows us to build most of what we need without the emulator running
# and using resources
- name: Build sample app and benchmark
run: ./gradlew assembleNonMinifiedRelease
- name: Clear unused Gradle 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
# If we're on main branch, copy over the baseline profile and
# commit it to the repository (if changed)
- name: Commit baseline profile into main
if: github.ref == 'refs/heads/main'
run: |
# Pull down any changes which may have been committed while this workflow has been running
git pull
# If the baseline profile has changed, commit it
if [[ $(git diff --stat haze/src/androidMain/generated/baselineProfiles/baseline-prof.txt) != '' ]]; then
git config user.name github-actions
git config user.email [email protected]
git add haze/src/androidMain/generated/baselineProfiles/baseline-prof.txt
git commit -m "Update baseline profile" && git push
fi
- name: Upload baseline profile
uses: actions/upload-artifact@v4
with:
name: baseline-profile-output
path: internal/baseline-profile/build/outputs/managed_device_android_test_additional_output
- name: Upload reports
if: always()
uses: actions/upload-artifact@v4
with:
name: reports
path: |
**/build/reports/*