Created
September 4, 2025 09:32
-
-
Save cdeil/1cfe79a056acf9bce507db46cd5e350d to your computer and use it in GitHub Desktop.
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: Integration Tests | |
| on: [pull_request] | |
| jobs: | |
| android-test: | |
| runs-on: ubuntu-latest-8-core | |
| timeout-minutes: 25 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: β Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: ${{ vars.JAVA_VERSION }} | |
| - name: ποΈ Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: π¦ Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| flutter-version: ${{ vars.FLUTTER_VERSION }} | |
| cache: true | |
| - name: π Set up SSH for private dependencies | |
| uses: webfactory/[email protected] | |
| with: | |
| ssh-private-key: ${{ secrets.SSH_KEY_GITHUB }} | |
| - name: π§ Configure Git to use SSH for GitHub | |
| run: | | |
| git config --global url."[email protected]:".insteadOf "https://github.com/" | |
| - name: π§ Configure Gradle (CI-friendly flags) | |
| run: | | |
| mkdir -p ~/.gradle | |
| cat >> ~/.gradle/gradle.properties << 'EOF' | |
| org.gradle.jvmargs=-Xmx6g -Xms1g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8 | |
| org.gradle.caching=true | |
| org.gradle.configuration-cache=true | |
| org.gradle.configuration-cache.parallel=true | |
| org.gradle.parallel=true | |
| org.gradle.logging.level=lifecycle | |
| org.gradle.console=plain | |
| android.useAndroidX=true | |
| android.enableJetifier=false | |
| EOF | |
| - name: π¦ Flutter pub get | |
| run: flutter pub get --suppress-analytics | |
| - name: π± Enable KVM (for hardware-accelerated emulator) | |
| 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 Integration Tests on Emulator | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| timeout-minutes: 15 | |
| with: | |
| api-level: ${{ vars.ANDROID_API_LEVEL }} | |
| arch: x86_64 | |
| target: google_apis | |
| profile: pixel_5 | |
| # rely on defaults: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim | |
| disable-animations: true | |
| emulator-boot-timeout: 600 | |
| script: | | |
| adb wait-for-device | |
| adb shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done; input keyevent 82' | |
| echo "Starting integration tests..." | |
| # Run tests and capture output | |
| flutter test integration_test --reporter=compact 2>&1 | tee test-output.txt || echo "Tests completed with exit code $?" | |
| - name: π Upload logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-integration-logs | |
| path: | | |
| test-output.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment