Feature/after benchmarks #9
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: 30 | |
| target: default | |
| arch: x86_64 | |
| emulator-boot-timeout: 900 # Increase from 600 to 900 seconds (15 minutes) | |
| emulator-options: -no-snapshot-load -no-snapshot-save -no-window -gpu swiftshader_indirect -no-audio | |
| script: ./gradlew :benchmarks:connectedBenchmarkAndroidTest | |
| - 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 |