feat(agent): add configurable network timeouts for LLM and SearXNG #280
Workflow file for this run
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: Android CI | |
| on: | |
| push: | |
| branches: [ "main", "master" ] | |
| pull_request: | |
| branches: [ "main", "master" ] | |
| jobs: | |
| test: | |
| name: Run Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Run unit tests | |
| run: ./gradlew testDebugUnitTest | |
| - name: Run Android Lint | |
| run: ./gradlew lintDebug | |
| test-emulator: | |
| name: Run Android Tests on Emulator | |
| runs-on: ubuntu-latest | |
| needs: test | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| api-level: [35, 36] | |
| shard-index: [0, 1, 2, 3, 4, 5] | |
| total-shards: [6] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Enable KVM group perms | |
| 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: Gradle cache | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: AVD cache | |
| uses: actions/cache@v5 | |
| id: avd-cache | |
| with: | |
| path: | | |
| ~/.android/avd/* | |
| ~/.android/adb* | |
| key: avd-${{ matrix.api-level }}-google_apis | |
| - name: Create AVD and generate snapshot for caching | |
| if: steps.avd-cache.outputs.cache-hit != 'true' | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: ${{ matrix.api-level }} | |
| target: google_apis | |
| arch: x86_64 | |
| profile: pixel_7_pro | |
| force-avd-creation: false | |
| emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
| disable-animations: true | |
| script: echo "Generated AVD snapshot for caching." | |
| - name: Run Android tests on emulator | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: ${{ matrix.api-level }} | |
| target: google_apis | |
| arch: x86_64 | |
| profile: pixel_7_pro | |
| force-avd-creation: false | |
| emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
| disable-animations: true | |
| disable-spellchecker: true | |
| script: | | |
| # Wait for emulator to fully boot and stabilize | |
| adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;' | |
| # Dismiss system dialogs and keyguard | |
| adb shell am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS | |
| adb shell wm dismiss-keyguard 2>/dev/null || true | |
| # Unlock screen (KEYCODE_MENU works more reliably than 82 on newer APIs) | |
| adb shell input keyevent 26 # Power button to wake | |
| sleep 2 | |
| adb shell input keyevent 82 # Menu to unlock | |
| # Keep screen on and disable lock settings | |
| adb shell svc power stayon true | |
| adb shell locksettings set-disabled true 2>/dev/null || true | |
| # Wait for UI to settle | |
| sleep 8 | |
| # Verify focus before running tests (debug helper) | |
| adb shell dumpsys window | grep -E "mCurrentFocus|mFocusedApp" || true | |
| # Run tests with additional JVM args for Espresso timeout | |
| ./gradlew connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.numShards=${{ matrix.total-shards }} -Pandroid.testInstrumentationRunnerArguments.shardIndex=${{ matrix.shard-index }} -Dorg.gradle.jvmargs="-Xmx4g -XX:MaxMetaspaceSize=1g" --stacktrace --no-daemon | |
| timeout-minutes: 25 | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results-api${{ matrix.api-level }}-shard${{ matrix.shard-index }} | |
| path: | | |
| app/build/reports/androidTests/ | |
| app/build/outputs/androidTest-results/ | |
| build: | |
| name: Build APK | |
| runs-on: ubuntu-latest | |
| needs: test-emulator | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build debug APK | |
| run: ./gradlew assembleDebug | |
| - name: Upload APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: app-debug | |
| path: app/build/outputs/apk/debug/app-debug.apk |