Skip to content

Update github auth action #579

Update github auth action

Update github auth action #579

name: Builds Macrobenchmarks
on:
pull_request:
push:
branches: [ macrobenchmark, main ]
jobs:
# This job checks for any file changed within MacrobenchmarkSample/ folder
# to distinguish if the build check for Macrobenchmark is needed to be run.
# It sets the outputs.macrobenchmark to true/false based on the changes.
# In the next build job, it checks for needs.changes.outputs.macrobenchmark == 'true'
# or skips the job otherwise.
changes:
if: github.repository_owner == 'android'
runs-on: ubuntu-latest
# Set job outputs to values from filter step to be able to use it in next job
outputs:
macrobenchmark: ${{ steps.filter.outputs.macrobenchmark }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
macrobenchmark:
- 'MacrobenchmarkSample/**'
build:
needs: changes
# Only run action for the main repo & not forks and if change is in macrobenchmark sample
if: github.repository_owner == 'android' && (needs.changes.outputs.macrobenchmark == 'true' || github.event_name == 'workflow_dispatch')
runs-on: macos-latest
defaults:
run:
working-directory: ./MacrobenchmarkSample
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup JDK
id: setup-java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'zulu'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
- name: Build Macrobenchmark Sample
run: >
./gradlew assemble \
-x :macrobenchmark:pixel6Api31NonMinifiedReleaseAndroidTest \
-x :macrobenchmark:collectNonMinifiedReleaseBaselineProfile \
-Pandroidx.benchmark.enabledRules=BaselineProfile \
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" \
-Pandroid.experimental.testOptions.managedDevices.setupTimeoutMinutes=180 \
-Pandroid.experimental.androidTest.numManagedDeviceShards=1 \
-Pandroid.experimental.testOptions.managedDevices.maxConcurrentDevices=1