Feature/after benchmarks #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # ── Lint & unit tests ──────────────────────────────────────────────────────── | |
| lint-and-test: | |
| name: Lint & Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Make gradlew executable | |
| run: chmod +x gradlew | |
| - uses: actions/setup-java@v4 | |
| with: | |
| java-version: 17 | |
| distribution: temurin | |
| - uses: gradle/actions/setup-gradle@v3 | |
| - name: Run lint | |
| run: ./gradlew lint | |
| - name: Run unit tests | |
| run: ./gradlew testDebugUnitTest | |
| - name: Upload lint reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lint-reports | |
| path: '**/build/reports/lint-results-*.html' | |
| if-no-files-found: warn | |
| # ── Macrobenchmark ──────────────────────────────────────────────────────────── | |
| benchmark: | |
| name: Macrobenchmark | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Make gradlew executable | |
| run: chmod +x gradlew | |
| - uses: actions/setup-java@v4 | |
| with: | |
| java-version: 17 | |
| distribution: temurin | |
| - uses: gradle/actions/setup-gradle@v3 | |
| # Required for hardware-accelerated emulator on GitHub-hosted runners. | |
| - name: Enable KVM | |
| run: | | |
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
| sudo udevadm control --reload-rules | |
| sudo udevadm trigger --name-match=kvm | |
| - name: Run Macrobenchmarks | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: 34 | |
| target: default | |
| arch: x86_64 | |
| emulator-boot-timeout: 600 | |
| disable-animations: true | |
| # -no-window / -no-audio / -no-boot-anim reduce emulator overhead on the | |
| # hosted runner; -gpu swiftshader_indirect avoids host-GPU dependency. | |
| # Together these keep the event queue idle enough for IsolationActivity | |
| # to launch within Macrobenchmark's 45-second window. | |
| emulator-options: -no-window -no-audio -no-boot-anim -gpu swiftshader_indirect | |
| script: | | |
| # Belt-and-suspenders: disable animations explicitly even though | |
| # disable-animations:true already does this — guards against any race | |
| # between emulator boot and the adb commands in the action. | |
| adb shell settings put global window_animation_scale 0 | |
| adb shell settings put global transition_animation_scale 0 | |
| adb shell settings put global animator_duration_scale 0 | |
| ./gradlew :benchmarks:connectedBenchmarkBenchmarkAndroidTest | |
| - name: Parse Benchmark Results | |
| if: always() | |
| run: | | |
| echo "### Macrobenchmark Results" >> $GITHUB_STEP_SUMMARY | |
| python3 benchmarks/BenchmarkResultsParser.py | tee -a $GITHUB_STEP_SUMMARY | |
| exit ${PIPESTATUS[0]} | |
| - name: Upload benchmark JSON | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: benchmark-results | |
| path: benchmarks/build/outputs/connected_android_test_additional_output/**/*-benchmarkData.json | |
| if-no-files-found: warn |