|
52 | 52 | -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true |
53 | 53 | -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" |
54 | 54 |
|
55 | | - - name: Build all build type and flavor permutations including baseline profiles |
56 | | - run: ./gradlew :app:assemble |
57 | | - -Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=baselineprofile |
58 | | - -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" |
59 | | - -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true |
| 55 | + # This generates both baseline and startup profile and adds them into the generated folder |
| 56 | + - name: Generate Baseline Profile |
| 57 | + run: ./gradlew :app:generateReleaseBaselineProfile |
| 58 | + -Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=baselineprofile |
| 59 | + -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" |
| 60 | + --stacktrace |
| 61 | + |
| 62 | + - name: Config Git |
| 63 | + run: | |
| 64 | + git config --global user.email "github-actions[bot]@users.noreply.github.com" |
| 65 | + git config --global user.name "github-actions[bot]" |
| 66 | +
|
| 67 | + # This checks if baseline and startup profile are available, then proceed. |
| 68 | + - name: Commit and Push Changes |
| 69 | + run: | |
| 70 | + if [ -d "app/src/main/baseline-prof.txt" ] || [ -d "app/build/baselineProfiles" ]; then |
| 71 | + echo "Found baseline profile changes" |
| 72 | + git add app/src/main/baseline-prof.txt || true |
| 73 | + git add app/build/baselineProfiles/release/baseline-prof.txt || true |
| 74 | + git commit -m "Update baseline profiles [automated]" |
| 75 | + git push |
| 76 | + else |
| 77 | + echo "No baseline profile changes found" |
| 78 | + echo "Checked locations:" |
| 79 | + echo "- app/src/main/baseline-prof.txt" |
| 80 | + echo "- app/build/baselineProfiles/release/baseline-prof.txt" |
| 81 | + ls -la app/src/main || echo "Main directory not found" |
| 82 | + ls -la app/build/baselineProfiles/release || echo "Release profiles directory not found" |
| 83 | + exit 1 |
| 84 | + fi |
0 commit comments