Skip to content

Debug mobile CI failures #480

Debug mobile CI failures

Debug mobile CI failures #480

Workflow file for this run

name: Mobile Demo Test Run
env:
DEVICE_NAME: vividus-test-device
ANDROID_EMU_ABI: x86
ANDROID_EMU_TARGET: android-30
ANDROID_EMU_TAG: default
IOS_DEVICE_TYPE_ID: iPhone 14 Pro Max
on:
workflow_dispatch:
schedule:
- cron: '30 4 * * MON-FRI'
push:
branches:
- main
paths:
- '**/mobile_app/**'
- '**/android/**'
- '**/ios/**'
- '.github/workflows/mobile-test-run.yml'
pull_request:
branches:
- main
paths:
- '**/mobile_app/**'
- '**/android/**'
- '**/ios/**'
- '.github/workflows/mobile-test-run.yml'
jobs:
mobile-test-run:
runs-on: macos-latest
strategy:
matrix:
platform: [Android, iOS]
fail-fast: false
steps:
- name: Checkout (including submodules)
uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache tests history
uses: pat-s/[email protected]
with:
path: output/history
key: tests-history-cache
restore-keys: |
tests-history-cache
- name: Spin-up iOS simulator
if: matrix.platform == 'iOS'
run: xcrun simctl create "$DEVICE_NAME" "$IOS_DEVICE_TYPE_ID" | xargs xcrun simctl boot
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
cache: 'gradle'
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- name: Install Appium
run: npm i -g [email protected]
- name: Install XCUITest driver
if: matrix.platform == 'iOS'
run: appium driver install xcuitest
- name: Install UiAutomator2 driver
if: matrix.platform == 'Android'
run: appium driver install uiautomator2
- name: Start appium server
run: appium --relaxed-security --log-timestamp --log appium.log &
- name: Run iOS tests
if: matrix.platform == 'iOS'
run: |
./gradlew runStories -Pvividus.configuration.suites=mobile_app/ios \
-Pvividus.configuration.profiles=mobile_app/local2,mobile_app/ios \
-Pvividus.allure.history-directory=output/history/ios \
-Pvividus.selenium.grid.capabilities.showXcodeLog=true \
-Pvividus.selenium.grid.capabilities.wdaLaunchTimeout=360000 \
-Pvividus.selenium.grid.capabilities.appium\:simulatorStartupTimeout=600000 \
-Pvividus.selenium.grid.capabilities.udid="$(xcrun simctl list | grep "$DEVICE_NAME" | sed 's/[^(]*(\([^()]*\)).*/\1/g')" \
-Pvividus.selenium.grid.capabilities.deviceName="$DEVICE_NAME"
- name: Run Android tests
if: matrix.platform == 'Android'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
avd-name: ${{ env.DEVICE_NAME }}
force-avd-creation: false
emulator-options: -no-snapshot -delay-adb
script: |
./gradlew runStories -Pvividus.configuration.suites=mobile_app/android \
-Pvividus.configuration.profiles=mobile_app/local2,mobile_app/android \
-Pvividus.allure.history-directory=output/history/android \
-Pvividus.selenium.grid.capabilities.deviceName="$DEVICE_NAME"
- name: Publish ${{ matrix.platform }} tests report
if: always()
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform }} tests report
path: output/reports/allure
- name: Print appium logs
if: always()
run: cat ./appium.log