Skip to content

Weekly workflow

Weekly workflow #55

Workflow file for this run

name: Weekly workflow
on:
schedule:
- cron: "0 0 * * 6" # At 00:00 on Saturday.
workflow_dispatch:
jobs:
update-gradle-wrapper:
name: Update Gradle Wrapper
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Update Gradle Wrapper
uses: gradle-update/[email protected]
with:
labels: Change type > dependencies
repo-token: ${{ secrets.PAT_GITHUB }}
baseline-profiles:
runs-on: macos-latest
timeout-minutes: 45
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
distribution: 'adopt'
java-version: 17
- name: Build app and benchmark
run: ./gradlew :benchmark-macro:assembleBenchmark
- name: Clear unused Gradle Managed Devices
run: ./gradlew cleanManagedDevices --unused-only
- name: Run benchmark on Gradle Managed Device
# --info used to add a repro to https://issuetracker.google.com/issues/193118030
# config cache is disabled due to https://issuetracker.google.com/issues/262270582
run: |
./gradlew api31BenchmarkAndroidTest \
-Dorg.gradle.workers.max=1 \
-Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=BaselineProfile \
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" \
--no-configuration-cache
# If we're on main branch, copy over the baseline profile and commit it to the repository
- 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
# Copy the baseline profile to :app
cp benchmark/build/outputs/managed_device_android_test_additional_output/api31/BaselineProfileGenerator_generateBaselineProfile-baseline-prof.txt app/src/main/baseline-prof.txt
# If the baseline profile has changed, commit it
if [[ $(git diff --stat app/src/main/baseline-prof.txt) != '' ]]; then
git config user.name github-actions
git config user.email [email protected]
git add app/src/main/baseline-prof.txt
git commit -m "Update app baseline profile" && git push --no-verify
fi
- name: Upload baseline profile
uses: actions/upload-artifact@v3
with:
name: baseline-profile-output
path: benchmark/build/outputs/managed_device_android_test_additional_output
- name: Upload test results Artifact
uses: actions/[email protected]
if: always()
with:
name: baseline-profile-test-report-avd-${{ matrix.api-level }}-${{ matrix.target }}-${{ matrix.arch }}
path: |
**/build/reports/*
if-no-files-found: warn