-
Notifications
You must be signed in to change notification settings - Fork 9
166 lines (137 loc) · 4.6 KB
/
android-regression.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: Run android regression tests
on:
workflow_dispatch:
inputs:
APK_URL:
description: 'APK.tar.gz url to test'
required: true
type: string
default: https://oxen.rocks/oxen-io/session-android/release/1.19.2/session-android-20240821T063349Z-20e1fbceb-universal.tar.xz
APPIUM_REPO:
description: 'appium repo to checkout'
required: true
type: string
default: oxen-io/session-appium
BRANCH_TO_CHECKOUT:
description: 'branch to checkout'
required: true
type: string
default: august
SHARD_NUMBER:
description: 'shard number'
required: true
type: string
default: '1'
SHARD_COUNT:
description: 'shard count'
required: true
type: string
default: '1'
PRINT_FAILED_TEST_LOGS:
description: 'print failed test logs (1 to enable)'
required: true
type: string
default: '0'
PRINT_ONGOING_TEST_LOGS:
description: 'print ongoing test logs (1 to enable)'
required: true
type: string
default: '0'
# concurrency:
# group: ${{ github.workflow }}
# cancel-in-progress: true
jobs:
android-regression:
runs-on: [self-hosted, linux, x64, qa-android]
env:
ANDROID_APP_PATH_PREFIX: "../extracted/session-android.apk"
APPIUM_ADB_FULL_PATH: "/opt/android/platform-tools/adb"
ANDROID_SDK_ROOT: "/opt/android"
PLAYWRIGHT_WORKERS_COUNT: 1
PLAYWRIGHT_RETRIES_COUNT: 0
PRINT_FAILED_TEST_LOGS: ${{ github.event.inputs.PRINT_FAILED_TEST_LOGS }}
PRINT_ONGOING_TEST_LOGS: ${{ github.event.inputs.PRINT_ONGOING_TEST_LOGS }}
IOS_APP_PATH_PREFIX: "just_not_empty"
IOS_FIRST_SIMULATOR: "just_not_empty"
IOS_SECOND_SIMULATOR: "just_not_empty"
IOS_THIRD_SIMULATOR: "just_not_empty"
IOS_FOURTH_SIMULATOR: "just_not_empty"
IOS_FIFTH_SIMULATOR: "just_not_empty"
IOS_SIXTH_SIMULATOR: "just_not_empty"
IOS_SEVENTH_SIMULATOR: "just_not_empty"
IOS_EIGHTH_SIMULATOR: "just_not_empty"
steps:
- uses: actions/checkout@v4
- name: Runner Details
run: |
echo "BRANCH_TO_CHECKOUT ${{ github.event.inputs.BRANCH_TO_CHECKOUT }}"
echo "APPIUM_REPO ${{ github.event.inputs.APPIUM_REPO }}"
echo "APK_URL ${{ github.event.inputs.APK_URL }}"
echo "SHARD_NUMBER ${{ github.event.inputs.SHARD_NUMBER }}"
echo "SHARD_COUNT ${{ github.event.inputs.SHARD_COUNT }}"
- name: Download APK
run: |
wget -q -O session-android.apk.tar.xz ${{ github.event.inputs.APK_URL }}
ls
pwd
- name: Extract APK
run: |
tar xf session-android.apk.tar.xz
ls
pwd
- name: Rename extracted folder
run: |
mv session-android-*universal extracted
ls extracted
mv extracted/*.apk extracted/session-android.apk
ls extracted
pwd
- uses: actions/checkout@v4
with:
repository: ${{ github.event.inputs.APPIUM_REPO }}
ref: ${{ github.event.inputs.BRANCH_TO_CHECKOUT }}
path: 'forked-session-appium'
- uses: actions/setup-node@v4
with:
# node-version-file: 'forked-session-appium/.nvmrc'
node-version: 18.15.0
- name: Install yarn
run: |
npm install -g yarn
corepack enable
yarn set version 4.1.1
- name: Install test dependencies
run: |
cd forked-session-appium
ls
git status
touch yarn.lock
yarn install --immutable
- name: Build the Android tests
run: |
cd forked-session-appium
yarn tsc
- name: Restart adb server
shell: bash
continue-on-error: true # just so we don't fail if adb wasn't alreadu running
run: |
source ./scripts/ci.sh
adb kill-server;
adb start-start;
- name: Start 4 android emulators with snapshots
shell: bash
run: |
source ./scripts/ci.sh
start_with_snapshots
- name: Run the Android tests
run: |
cd forked-session-appium
pwd
yarn test-android-shard ${{ github.event.inputs.SHARD_NUMBER }}/${{ github.event.inputs.SHARD_COUNT }}
- name: Killall running emulators
if: always()
continue-on-error: true # just so we don't fail
shell: bash
run: |
source ./scripts/ci.sh
killall_emulators