Skip to content

Commit 9965ccc

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

File tree

3 files changed

+76
-83
lines changed

3 files changed

+76
-83
lines changed

.azure-templates/bootstrap_steps.yml

-10
This file was deleted.

.github/workflows/gradle.yml

+76-4
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,95 @@ on:
1414
- 'docs/**'
1515
- '*.md'
1616

17+
env:
18+
ANDROID_EMU_NAME: test
19+
ANDROID_EMU_ABI: x86
20+
ANDROID_EMU_TARGET: android-28
21+
ANDROID_EMU_TAG: default
22+
XCODE_VERSION: 14.2
23+
IOS_DEVICE_NAME: iPhone 12
24+
IOS_PLATFORM_VERSION: 16.2
25+
1726
jobs:
1827
build:
1928

20-
runs-on: macOS-latest
21-
2229
strategy:
2330
matrix:
24-
java: [ 8, 11, 17 ]
31+
include:
32+
- java: 8
33+
platform: macos-latest
34+
e2e-tests: android
35+
- java: 11
36+
platform: macos-latest
37+
e2e-tests: ios
38+
- java: 17
39+
platform: ubuntu-latest
40+
fail-fast: false
2541

26-
name: JDK ${{ matrix.java }}
42+
runs-on: ${{ matrix.platform }}
43+
44+
name: JDK ${{ matrix.java }} - ${{ matrix.platform }}
2745
steps:
2846
- uses: actions/checkout@v3
47+
2948
- name: Set up JDK ${{ matrix.java }}
3049
uses: actions/setup-java@v3
3150
with:
3251
distribution: 'zulu'
3352
java-version: ${{ matrix.java }}
3453
cache: 'gradle'
54+
3555
- name: Build with Gradle
3656
run: ./gradlew clean build
57+
58+
- name: Install Node.js
59+
if: ${{ matrix.e2e-tests == 'android' || matrix.e2e-tests == 'ios' }}
60+
uses: actions/setup-node@v3
61+
with:
62+
node-version: 'lts/*'
63+
64+
- name: Install Appium
65+
if: matrix.e2e-tests == 'android' || matrix.e2e-tests == 'ios'
66+
run: npm install -g appium@next
67+
68+
- name: Install UIA2 driver
69+
if: matrix.e2e-tests == 'android'
70+
run: appium driver install uiautomator2
71+
72+
- name: Prepare Android emulator
73+
if: matrix.e2e-tests == 'android'
74+
run: |
75+
echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install "system-images;$ANDROID_EMU_TARGET;$ANDROID_EMU_TAG;$ANDROID_EMU_ABI"
76+
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
77+
echo $ANDROID_HOME/emulator/emulator -list-avds
78+
79+
echo "Starting emulator"
80+
nohup $ANDROID_HOME/emulator/emulator -avd "$ANDROID_EMU_NAME" -no-snapshot -delay-adb > /dev/null 2>&1 &
81+
$ANDROID_HOME/platform-tools/adb wait-for-device
82+
$ANDROID_HOME/platform-tools/adb devices -l
83+
echo "Emulator started"
84+
85+
- name: Run Android E2E tests
86+
if: matrix.e2e-tests == 'android'
87+
run: ./gradlew uiAutomationTest
88+
89+
- name: Install XCUITest driver
90+
if: matrix.e2e-tests == 'ios'
91+
run: appium driver install xcuitest
92+
93+
- name: Prebuild XCUITest driver
94+
if: matrix.e2e-tests == 'ios'
95+
run: appium driver run xcuitest build-wda
96+
97+
- name: Prepare iOS simulator
98+
if: matrix.e2e-tests == 'ios'
99+
run: |
100+
sudo xcode-select -s /Applications/Xcode_$XCODE_VERSION.app/Contents/Developer
101+
xcrun simctl list
102+
target_sim_id=$(xcrun simctl list devices available | grep "$IOS_DEVICE_NAME (" | cut -d "(" -f2 | cut -d ")" -f1)
103+
open -Fn "/Applications/Xcode_$XCODE_VERSION.app/Contents/Developer/Applications/Simulator.app"
104+
xcrun simctl bootstatus $target_sim_id -b
105+
106+
- name: Run iOS E2E tests
107+
if: matrix.e2e-tests == 'ios'
108+
run: ./gradlew xcuiTest

azure-pipelines.yml

-69
This file was deleted.

0 commit comments

Comments
 (0)