Skip to content

Commit

Permalink
.github: add integration test on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
wfleischer committed Dec 7, 2024
1 parent dc62331 commit 0e42add
Showing 1 changed file with 47 additions and 5 deletions.
52 changes: 47 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,70 @@ jobs:

steps:
- uses: actions/checkout@v3

- uses: subosito/flutter-action@v2
with:
channel: 'stable'

- run: ./check.sh


test-android:
name: Test Android
runs-on: ubuntu-latest
needs: checks

steps:
- uses: actions/checkout@v3

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable

- name: Set up Android SDK
uses: android-actions/setup-android@v2

- name: Create AVD
run: |
avdmanager list device
sdkmanager "system-images;android-30;google_apis;x86_64"
avdmanager create avd -n test -k "system-images;android-30;google_apis;x86_64"
$ANDROID_HOME/emulator/emulator -d pixel_5
- name: Start Android emulator
run: |
sudo apt-get update
sudo apt-get install -y lib32stdc++6 qemu-kvm
sudo $ANDROID_HOME/emulator/emulator -avd pixel_5 -no-window -no-audio -no-boot-anim -accel on &
sudo $ANDROID_HOME/platform-tools/adb wait-for-device
sudo $ANDROID_HOME/platform-tools/adb shell input keyevent 82
- name: Run integration tests
run: flutter test integration_test --timeout 2x


test-ios:
name: Test iOS
runs-on: macos-latest
needs: checks

steps:
- uses: actions/checkout@v3

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable

- name: List all simulators
run: "xcrun xctrace list devices"

- name: Start simulator
run: |
UDID=$(xcrun xctrace list devices | grep "^iPhone 15 Simulator (18.1)" | awk '{gsub(/[()]/,""); print $NF}')
echo $UDID
xcrun simctl boot "${UDID:?No Simulator with this name found}"
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: stable
- run: flutter test integration_test --timeout 2x
- name: Run integration tests
run: flutter test integration_test --timeout 2x

0 comments on commit 0e42add

Please sign in to comment.