From e1dd7876383d215d3c8d9a965afae4c40ac5c111 Mon Sep 17 00:00:00 2001 From: nikhil kumar Date: Tue, 18 Jun 2024 17:30:58 +0530 Subject: [PATCH] TP-70392 | Setting up Jetpack Macrobenchmarks for CI using Firebase Test Lab (#11432) --- .github/workflows/macrobenchmark_perf.yml | 63 +++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/macrobenchmark_perf.yml diff --git a/.github/workflows/macrobenchmark_perf.yml b/.github/workflows/macrobenchmark_perf.yml new file mode 100644 index 0000000000..23af244491 --- /dev/null +++ b/.github/workflows/macrobenchmark_perf.yml @@ -0,0 +1,63 @@ +name: Build and Run Macrobenchmarks + +on: + workflow_dispatch: + +jobs: + build: + runs-on: [ default ] + outputs: + benchmark: ${{ steps.filter.outputs.benchmark }} + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: temurin + + - name: Build Macrobenchmark + uses: eskatos/gradle-command-action@v1 + env: + JAVA_HOME: ${{ steps.setup-java.outputs.path }} + with: + arguments: | + :app:assembleBenchmark + :benchmark:assembleBenchmark + build-root-directory: ${{ github.workspace }}/android + gradle-executable: ${{ github.workspace }}/android/gradlew + wrapper-directory: ${{ github.workspace }}/android/gradle/wrapper + + - name: Print Inputs + run: | + echo "| github.workspace | " >> ${{ github.workspace }}/android + + + - name: 'Authenticate Cloud SDK' + uses: 'google-github-actions/auth@v0' + with: + credentials_json: '${{ secrets.GCP_CREDENTIALS }}' + + - name: Set up Cloud SDK + uses: google-github-actions/setup-gcloud@v0 + + - name: Install Cloud SDK Beta components + run: gcloud components install beta + + - name: Run Macro Benchmarks + run: | + gcloud beta firebase test android run \ + --type instrumentation \ + --app ${{ github.workspace }}/android/app/build/outputs/apk/benchmark/app-benchmark.apk \ + --test ${{ github.workspace }}/android/benchmark/build/outputs/apk/benchmark/benchmark-benchmark.apk \ + --device model=redfin,version=30,locale=en,orientation=portrait \ + --directories-to-pull /sdcard/Download \ + --results-bucket gs://benchmark-results \ + --environment-variables clearPackageData=true,additionalTestOutputDir=/sdcard/Download,no-isolated-storage=true,androidx.benchmark.enabledRules=Macrobenchmark \ + --num-uniform-shards 3 \ + --timeout 60m +