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