diff --git a/.github/workflows/NightlyBaselineProfiles.yaml b/.github/workflows/NightlyBaselineProfiles.yaml index 288842ac7..61f96cad7 100644 --- a/.github/workflows/NightlyBaselineProfiles.yaml +++ b/.github/workflows/NightlyBaselineProfiles.yaml @@ -52,8 +52,33 @@ jobs: -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" - - name: Build all build type and flavor permutations including baseline profiles - run: ./gradlew :app:assemble - -Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=baselineprofile - -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" - -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true + # This generates both baseline and startup profile and adds them into the generated folder + - name: Generate Baseline Profile + run: ./gradlew :app:generateReleaseBaselineProfile + -Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=baselineprofile + -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" + --stacktrace + + - name: Config Git + run: | + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + + # This checks if baseline and startup profile are available, then proceed. + - name: Commit and Push Changes + run: | + if [ -d "app/src/main/baseline-prof.txt" ] || [ -d "app/build/baselineProfiles" ]; then + echo "Found baseline profile changes" + git add app/src/main/baseline-prof.txt || true + git add app/build/baselineProfiles/release/baseline-prof.txt || true + git commit -m "Update baseline profiles [automated]" + git push + else + echo "No baseline profile changes found" + echo "Checked locations:" + echo "- app/src/main/baseline-prof.txt" + echo "- app/build/baselineProfiles/release/baseline-prof.txt" + ls -la app/src/main || echo "Main directory not found" + ls -la app/build/baselineProfiles/release || echo "Release profiles directory not found" + exit 1 + fi