-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (63 loc) · 1.93 KB
/
Copy pathmobile-parallel.yml
File metadata and controls
77 lines (63 loc) · 1.93 KB
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
name: Mobile Parallel Real Device Tests
on:
push:
branches: [main]
jobs:
parallel-mobile-tests:
runs-on: [self-hosted, macOS, ARM64]
timeout-minutes: 60
env:
RUNNER_TOOL_CACHE: $HOME/_toolcache
steps:
- name: Ensure tool cache exists
run: mkdir -p $RUNNER_TOOL_CACHE
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Set up Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install Python dependencies
run: |
poetry install --no-interaction
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Appium and drivers
run: |
npm install -g appium@2.19.0
appium driver install uiautomator2
appium driver install xcuitest
- name: Kill existing Appium servers
run: |
lsof -ti:4723 | xargs kill -9 || true
lsof -ti:4724 | xargs kill -9 || true
- name: Start Appium servers
run: |
nohup appium -p 4723 > appium-ios.log 2>&1 &
nohup appium -p 4724 > appium-android.log 2>&1 &
- name: Wait for Appium servers
run: |
for i in {1..10}; do
if nc -z localhost 4723 && nc -z localhost 4724; then
echo "Appium servers are up!"
break
fi
echo "Waiting for Appium servers..."
sleep 2
done
- name: Run tests in parallel
run: |
poetry run python tests/test_parallel_mobile.py
- name: Upload Appium logs
uses: actions/upload-artifact@v4
with:
name: appium-logs
path: |
appium-ios.log
appium-android.log