Skip to content

Create deep link test runners for Android and iOS #18

Create deep link test runners for Android and iOS

Create deep link test runners for Android and iOS #18

name: Validate PR
on: [pull_request, workflow_dispatch]
jobs:
test_flutter-test-runners_deep-links_android:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/flutter_test_runners/example_deep_links
steps:
- name: Checkout Repository
uses: actions/checkout@v3
# The Android emulator action seems to want to include this.
- name: enable KVM for linux runners
working-directory: ~
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: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
architecture: x64
- name: Install Android SDK and launch emulator
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 35
target: default
arch: x86_64
profile: Galaxy Nexus
cores: 2
disk-size: 6000M
heap-size: 600M
sdcard-path-or-size: 100M
avd-name: github-ci-emulator
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: |
echo "Running emulator..."
echo "Working directory: $(pwd)"
echo ""
echo "Changing working directory to the example app"
ls -la
cd ./packages/flutter_test_runners/example_deep_links
echo "Working directory: $(pwd)"
echo ""
echo "Unlocking the screen"
adb shell input keyevent 82 # Unlock the emulator screen if it's locked
echo ""
echo "Getting Flutter dependencies"
flutter pub get
echo ""
echo "Building and installing the APK"
flutter run --debug -d emulator-5554 --target=packages/flutter_test_runners/example_deep_links/lib/main.dart
echo ""
echo "Running Flutter tests"
flutter test test_driver
# - name: Wait for Emulator to Start
# working-directory: ~
# run: |
# adb wait-for-device
# adb shell input keyevent 82 # Unlock the emulator screen if it's locked
#
# - name: Install Flutter Dependencies
# run: flutter pub get
#
# - name: Build Flutter App (Debug Mode)
# # Must be debug mode so we can enable Flutter Driver.
# run: flutter build apk --debug
#
# - name: Install App on Emulator
# run: flutter install --debug
#
# - name: Run deep link tests
# run: flutter test test_driver