Skip to content

Commit 77b94d1

Browse files
committed
ci: Move execution of E2E tests to GitHub Actions
1 parent 9c18b2f commit 77b94d1

File tree

3 files changed

+77
-83
lines changed

3 files changed

+77
-83
lines changed

.azure-templates/bootstrap_steps.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/workflows/gradle.yml

Lines changed: 77 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,93 @@ on:
1717
jobs:
1818
build:
1919

20-
runs-on: macOS-latest
21-
2220
strategy:
2321
matrix:
24-
java: [ 8, 11, 17 ]
22+
include:
23+
- java: 8
24+
platform: macos-latest
25+
e2e-tests: android
26+
- java: 11
27+
platform: macos-latest
28+
e2e-tests: ios
29+
- java: 17
30+
platform: ubuntu-latest
31+
fail-fast: false
32+
33+
runs-on: ${{ matrix.platform }}
2534

26-
name: JDK ${{ matrix.java }}
35+
name: JDK ${{ matrix.java }} - ${{ matrix.platform }}
2736
steps:
2837
- uses: actions/checkout@v3
38+
2939
- name: Set up JDK ${{ matrix.java }}
3040
uses: actions/setup-java@v3
3141
with:
3242
distribution: 'zulu'
3343
java-version: ${{ matrix.java }}
3444
cache: 'gradle'
45+
3546
- name: Build with Gradle
3647
run: ./gradlew clean build
48+
49+
- name: Install Node.js
50+
if: ${{ matrix.e2e-tests == 'android' || matrix.e2e-tests == 'ios' }}
51+
uses: actions/setup-node@v3
52+
with:
53+
node-version: '18'
54+
55+
- name: Install Appium
56+
if: matrix.e2e-tests == 'android' || matrix.e2e-tests == 'ios'
57+
run: npm install -g appium@next
58+
59+
- name: Install UIA2 driver
60+
if: matrix.e2e-tests == 'android'
61+
run: appium driver install uiautomator2
62+
63+
- name: Prepare Android emulator
64+
if: matrix.e2e-tests == 'android'
65+
env:
66+
ANDROID_EMU_NAME: test
67+
ANDROID_EMU_ABI: x86
68+
ANDROID_EMU_TARGET: android-28
69+
ANDROID_EMU_TAG: default
70+
run: |
71+
echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install "system-images;$ANDROID_EMU_TARGET;$ANDROID_EMU_TAG;$ANDROID_EMU_ABI"
72+
echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n "$ANDROID_EMU_NAME" -k "system-images;$ANDROID_EMU_TARGET;$ANDROID_EMU_TAG;$ANDROID_EMU_ABI" --force
73+
echo $ANDROID_HOME/emulator/emulator -list-avds
74+
75+
echo "Starting emulator"
76+
nohup $ANDROID_HOME/emulator/emulator -avd "$ANDROID_EMU_NAME" -no-snapshot -delay-adb > /dev/null 2>&1 &
77+
$ANDROID_HOME/platform-tools/adb wait-for-device
78+
$ANDROID_HOME/platform-tools/adb devices -l
79+
echo "Emulator started"
80+
81+
- name: Run Android E2E tests
82+
if: matrix.e2e-tests == 'android'
83+
run: ./gradlew uiAutomationTest
84+
85+
- name: Install XCUITest driver
86+
if: matrix.e2e-tests == 'ios'
87+
run: appium driver install xcuitest
88+
89+
- name: Prebuild XCUITest driver
90+
if: matrix.e2e-tests == 'ios'
91+
run: appium driver run xcuitest build-wda
92+
93+
- name: Prepare iOS simulator
94+
if: matrix.e2e-tests == 'ios'
95+
env:
96+
XCODE_VERSION: 14.2
97+
IOS_DEVICE_NAME: iPhone 12
98+
run: |
99+
sudo xcode-select -s /Applications/Xcode_$XCODE_VERSION.app/Contents/Developer
100+
xcrun simctl list
101+
target_sim_id=$(xcrun simctl list devices available | grep "$IOS_DEVICE_NAME (" | cut -d "(" -f2 | cut -d ")" -f1)
102+
open -Fn "/Applications/Xcode_$XCODE_VERSION.app/Contents/Developer/Applications/Simulator.app"
103+
xcrun simctl bootstatus $target_sim_id -b
104+
105+
- name: Run iOS E2E tests
106+
if: matrix.e2e-tests == 'ios'
107+
env:
108+
IOS_PLATFORM_VERSION: 16.2
109+
run: ./gradlew xcuiTest

azure-pipelines.yml

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)