Skip to content

use exceptionHandler during pigeon communication on mobile #6

use exceptionHandler during pigeon communication on mobile

use exceptionHandler during pigeon communication on mobile #6

Workflow file for this run

name: Build Android on PRs
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize]
jobs:
build_android:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
- name: Setup flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable' # or: 'beta', 'dev', 'master' (or 'main')
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path
- name: Print flutter version
run: flutter --version
- name: Setup Melos
uses: bluefireteam/melos-action@v3
- name: Pub get
run: flutter pub get
working-directory: flutter_theolive_sdk
- name: Run unit test
run: flutter test
working-directory: flutter_theolive_sdk
# configure for emulator
- 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: Gradle cache
uses: gradle/actions/setup-gradle@v3
- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-34
- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true' #check previous step output
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
target: google_apis
arch: x86_64
cores: 2
ram-size: 3072M
force-avd-creation: true
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 integration tests on emulator
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
target: google_apis
arch: x86_64
cores: 2
ram-size: 3072M
force-avd-creation: true
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: flutter test integration_test
working-directory: flutter_theolive_sdk/example
env:
TEST_LICENSE: ${{ secrets.TEST_LICENSE }}
- name: Build APK
run: flutter build apk
working-directory: flutter_theolive_sdk/example
- name: Build app bundle
run: flutter build appbundle
working-directory: flutter_theolive_sdk/example
- name: Save APK to artifacts
uses: actions/upload-artifact@v4
with:
name: example_app.apk
path: flutter_theolive_sdk/example/build/app/outputs/flutter-apk/app-release.apk
retention-days: 5