Skip to content

Commit ea7aaf3

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

File tree

3 files changed

+97
-83
lines changed

3 files changed

+97
-83
lines changed

.azure-templates/bootstrap_steps.yml

-10
This file was deleted.

.github/workflows/gradle.yml

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

17+
permissions:
18+
statuses: write
19+
checks: write
20+
1721
jobs:
1822
build:
1923

20-
runs-on: macOS-latest
21-
2224
strategy:
2325
matrix:
24-
java: [ 8, 11, 17 ]
26+
include:
27+
- java: 8
28+
platform: macos-latest
29+
e2e-tests: android
30+
- java: 11
31+
platform: macos-latest
32+
e2e-tests: ios
33+
- java: 17
34+
platform: ubuntu-latest
35+
fail-fast: false
36+
37+
runs-on: ${{ matrix.platform }}
2538

26-
name: JDK ${{ matrix.java }}
39+
name: JDK ${{ matrix.java }} - ${{ matrix.platform }}
2740
steps:
2841
- uses: actions/checkout@v3
42+
2943
- name: Set up JDK ${{ matrix.java }}
3044
uses: actions/setup-java@v3
3145
with:
3246
distribution: 'zulu'
3347
java-version: ${{ matrix.java }}
3448
cache: 'gradle'
49+
3550
- name: Build with Gradle
3651
run: ./gradlew clean build
52+
53+
- name: Install Node.js
54+
if: ${{ matrix.e2e-tests == 'android' || matrix.e2e-tests == 'ios' }}
55+
uses: actions/setup-node@v3
56+
with:
57+
node-version: '18'
58+
59+
- name: Install Appium
60+
if: matrix.e2e-tests == 'android' || matrix.e2e-tests == 'ios'
61+
run: npm install -g appium@next
62+
63+
- name: Install UIA2 driver
64+
if: matrix.e2e-tests == 'android'
65+
run: appium driver install uiautomator2
66+
67+
- name: Prepare Android emulator
68+
if: matrix.e2e-tests == 'android'
69+
env:
70+
ANDROID_EMU_NAME: test
71+
ANDROID_EMU_ABI: x86
72+
ANDROID_EMU_TARGET: android-28
73+
ANDROID_EMU_TAG: default
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: Report Android E2E test results
90+
uses: dorny/test-reporter@v1
91+
if: matrix.e2e-tests == 'android' && always()
92+
with:
93+
name: Android E2E test results
94+
path: build/test-results/uiAutomationTest/*.xml
95+
reporter: java-junit
96+
97+
- name: Install XCUITest driver
98+
if: matrix.e2e-tests == 'ios'
99+
run: appium driver install xcuitest
100+
101+
- name: Prebuild XCUITest driver
102+
if: matrix.e2e-tests == 'ios'
103+
run: appium driver run xcuitest build-wda
104+
105+
- name: Prepare iOS simulator
106+
if: matrix.e2e-tests == 'ios'
107+
env:
108+
XCODE_VERSION: 14.2
109+
IOS_DEVICE_NAME: iPhone 12
110+
run: |
111+
sudo xcode-select -s /Applications/Xcode_$XCODE_VERSION.app/Contents/Developer
112+
xcrun simctl list
113+
target_sim_id=$(xcrun simctl list devices available | grep "$IOS_DEVICE_NAME (" | cut -d "(" -f2 | cut -d ")" -f1)
114+
open -Fn "/Applications/Xcode_$XCODE_VERSION.app/Contents/Developer/Applications/Simulator.app"
115+
xcrun simctl bootstatus $target_sim_id -b
116+
117+
- name: Run iOS E2E tests
118+
if: matrix.e2e-tests == 'ios'
119+
env:
120+
IOS_PLATFORM_VERSION: 16.2
121+
run: ./gradlew xcuiTest
122+
123+
- name: Report iOS E2E test results
124+
uses: dorny/test-reporter@v1
125+
if: matrix.e2e-tests == 'ios' && always()
126+
with:
127+
name: iOS E2E test results
128+
path: build/test-results/xcuiTest/*.xml
129+
reporter: java-junit

azure-pipelines.yml

-69
This file was deleted.

0 commit comments

Comments
 (0)