Skip to content

Commit 4d74024

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

File tree

3 files changed

+91
-83
lines changed

3 files changed

+91
-83
lines changed

.azure-templates/bootstrap_steps.yml

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

.github/workflows/gradle.yml

Lines changed: 91 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,110 @@ on:
1414
- 'docs/**'
1515
- '*.md'
1616

17+
env:
18+
ANDROID_SDK_VERSION: 28
19+
ANDROID_EMU_NAME: test
20+
XCODE_VERSION: 14.2
21+
IOS_DEVICE_NAME: iPhone 12
22+
IOS_PLATFORM_VERSION: 16.2
23+
1724
jobs:
1825
build:
1926

20-
runs-on: macOS-latest
21-
2227
strategy:
2328
matrix:
24-
java: [ 8, 11, 17 ]
29+
include:
30+
- java: 8
31+
platform: macos-latest
32+
e2e-tests: android
33+
- java: 11
34+
platform: macos-12
35+
e2e-tests: ios
36+
- java: 17
37+
platform: ubuntu-latest
38+
fail-fast: false
39+
40+
runs-on: ${{ matrix.platform }}
2541

26-
name: JDK ${{ matrix.java }}
42+
name: JDK ${{ matrix.java }} - ${{ matrix.platform }}
2743
steps:
2844
- uses: actions/checkout@v3
45+
2946
- name: Set up JDK ${{ matrix.java }}
3047
uses: actions/setup-java@v3
3148
with:
3249
distribution: 'zulu'
3350
java-version: ${{ matrix.java }}
3451
cache: 'gradle'
52+
3553
- name: Build with Gradle
3654
run: ./gradlew clean build
55+
56+
- name: Install Node.js
57+
if: ${{ matrix.e2e-tests == 'android' || matrix.e2e-tests == 'ios' }}
58+
uses: actions/setup-node@v3
59+
with:
60+
node-version: 'lts/*'
61+
62+
- name: Install Appium
63+
if: matrix.e2e-tests == 'android' || matrix.e2e-tests == 'ios'
64+
run: npm install -g appium@next
65+
66+
- name: Install UIA2 driver
67+
if: matrix.e2e-tests == 'android'
68+
run: appium driver install uiautomator2
69+
70+
- name: AVD cache
71+
if: matrix.e2e-tests == 'android'
72+
uses: actions/cache@v3
73+
id: avd-cache
74+
with:
75+
path: |
76+
~/.android/avd/*
77+
~/.android/adb*
78+
key: avd-${{ env.ANDROID_SDK_VERSION }}
79+
80+
- name: Generate AVD snapshot for caching
81+
if: matrix.e2e-tests == 'android' && steps.avd-cache.outputs.cache-hit != 'true'
82+
uses: reactivecircus/android-emulator-runner@v2
83+
with:
84+
api-level: ${{ env.ANDROID_SDK_VERSION }}
85+
avd-name: ${{ env.ANDROID_EMU_NAME }}
86+
force-avd-creation: false
87+
script: echo "Generated AVD snapshot for caching."
88+
89+
- name: Run Android E2E tests
90+
if: matrix.e2e-tests == 'android'
91+
uses: reactivecircus/android-emulator-runner@v2
92+
with:
93+
api-level: ${{ env.ANDROID_SDK_VERSION }}
94+
avd-name: ${{ env.ANDROID_EMU_NAME }}
95+
force-avd-creation: false
96+
emulator-options: -no-snapshot -delay-adb
97+
script: ./gradlew uiAutomationTest
98+
99+
- name: Install XCUITest driver
100+
if: matrix.e2e-tests == 'ios'
101+
run: appium driver install xcuitest
102+
103+
- name: Prebuild XCUITest driver
104+
if: matrix.e2e-tests == 'ios'
105+
run: appium driver run xcuitest build-wda
106+
107+
- name: Select Xcode
108+
if: matrix.e2e-tests == 'ios'
109+
uses: maxim-lobanov/setup-xcode@v1
110+
with:
111+
xcode-version: "${{ env.XCODE_VERSION }}"
112+
113+
- name: Prepare iOS simulator
114+
if: matrix.e2e-tests == 'ios'
115+
run: |
116+
xcrun simctl list
117+
target_sim_id=$(xcrun simctl list devices available | grep "$IOS_DEVICE_NAME (" | cut -d "(" -f2 | cut -d ")" -f1)
118+
open -Fn "/Applications/Xcode_$XCODE_VERSION.app/Contents/Developer/Applications/Simulator.app"
119+
xcrun simctl bootstatus $target_sim_id -b
120+
121+
- name: Run iOS E2E tests
122+
if: matrix.e2e-tests == 'ios'
123+
run: ./gradlew xcuiTest

azure-pipelines.yml

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

0 commit comments

Comments
 (0)