-
-
Notifications
You must be signed in to change notification settings - Fork 760
111 lines (98 loc) · 3.44 KB
/
gradle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Appium Java Client CI
on:
push:
branches:
- master
paths-ignore:
- 'docs/**'
- '*.md'
pull_request:
branches:
- master
paths-ignore:
- 'docs/**'
- '*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
ANDROID_SDK_VERSION: "28"
ANDROID_EMU_NAME: test
ANDROID_EMU_TARGET: default
XCODE_VERSION: "14.2"
IOS_DEVICE_NAME: iPhone 12
IOS_PLATFORM_VERSION: "16.2"
jobs:
build:
strategy:
matrix:
include:
- java: 11
# Need to use specific (not `-latest`) version of macOS to be sure the required version of Xcode/simulator is available
platform: macos-12
e2e-tests: ios
- java: 17
platform: macos-latest
e2e-tests: android
- java: 21
platform: ubuntu-latest
fail-fast: false
runs-on: ${{ matrix.platform }}
name: JDK ${{ matrix.java }} - ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
cache: 'gradle'
- name: Build with Gradle
run: |
latest_snapshot=$(curl -sf https://oss.sonatype.org/content/repositories/snapshots/org/seleniumhq/selenium/selenium-api/ | \
python -c "import sys,re; print(re.findall(r'\d+\.\d+\.\d+-SNAPSHOT', sys.stdin.read())[-1])")
echo ">>> $latest_snapshot"
echo "latest_snapshot=$latest_snapshot" >> "$GITHUB_ENV"
./gradlew clean build -PisCI -Pselenium.version=$latest_snapshot
- name: Install Node.js
if: matrix.e2e-tests == 'android' || matrix.e2e-tests == 'ios'
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Install Appium
if: matrix.e2e-tests == 'android' || matrix.e2e-tests == 'ios'
run: npm install --location=global appium
- name: Install UIA2 driver
if: matrix.e2e-tests == 'android'
run: appium driver install uiautomator2
- name: Run Android E2E tests
if: matrix.e2e-tests == 'android'
uses: reactivecircus/android-emulator-runner@v2
with:
script: ./gradlew uiAutomationTest -PisCI -Pselenium.version=$latest_snapshot
api-level: ${{ env.ANDROID_SDK_VERSION }}
avd-name: ${{ env.ANDROID_EMU_NAME }}
sdcard-path-or-size: 1500M
disable-spellchecker: true
target: ${{ env.ANDROID_EMU_TARGET }}
- name: Select Xcode
if: matrix.e2e-tests == 'ios'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "${{ env.XCODE_VERSION }}"
- name: Install XCUITest driver
if: matrix.e2e-tests == 'ios'
run: appium driver install xcuitest
- name: Prebuild XCUITest driver
if: matrix.e2e-tests == 'ios'
run: appium driver run xcuitest build-wda
- name: Prepare iOS simulator
if: matrix.e2e-tests == 'ios'
run: |
xcrun simctl list
target_sim_id=$(xcrun simctl list devices available | grep "$IOS_DEVICE_NAME (" | cut -d "(" -f2 | cut -d ")" -f1)
open -Fn "/Applications/Xcode_$XCODE_VERSION.app/Contents/Developer/Applications/Simulator.app"
xcrun simctl bootstatus $target_sim_id -b
- name: Run iOS E2E tests
if: matrix.e2e-tests == 'ios'
run: ./gradlew xcuiTest -PisCI -Pselenium.version=$latest_snapshot