From 7ac497d7f0d8bea7bb0a9f46e14ba6d213d404f8 Mon Sep 17 00:00:00 2001 From: Werner Fleischer <70745309+wfleischer@users.noreply.github.com> Date: Fri, 6 Dec 2024 22:15:04 +0100 Subject: [PATCH] .github: add integration test on Android --- .github/workflows/test.yml | 45 +++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1bed573..4aa0221 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,28 +13,63 @@ 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: Start Android emulator + run: | + sudo apt-get update + sudo apt-get install -y lib32stdc++6 qemu-kvm + sudo $ANDROID_HOME/emulator/emulator -avd test -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