-
Notifications
You must be signed in to change notification settings - Fork 274
178 lines (169 loc) · 5.59 KB
/
e2e-tests.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: E2E Tests
on:
pull_request:
workflow_dispatch:
inputs:
run_nightly_checks:
description: 'Should nightly checks be executed?'
type: boolean
required: false
default: false
push: # FIXME
schedule:
# Runs "At 01:00 every night except weekends"
- cron: '0 1 * * 1-5'
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PR_NUM: ${{ github.event.pull_request.number }}
EMU_OPTIONS: "-no-snapshot-save -no-window -no-audio -no-boot-anim -gpu swiftshader_indirect -camera-back none -camera-front none"
jobs:
build-compose-apks:
name: Build Compose
runs-on: ubuntu-24.04
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/java-cache
- uses: ./.github/actions/enable-kvm
- uses: ./.github/actions/ruby-cache
- uses: ./.github/actions/gradle-cache
with:
key-prefix: gradle-test
- name: Build apks
run: bundle exec fastlane build_e2e_test
- name: Upload apks
uses: actions/[email protected]
with:
name: apks
path: |
stream-chat-android-compose-sample/build/outputs/apk/e2e/debug/*.apk
stream-chat-android-compose-sample/build/outputs/apk/androidTest/e2e/debug/*.apk
run-tests:
name: Test Compose
runs-on: ubuntu-24.04
if: ${{ github.event_name != 'schedule' }}
needs: build-compose-apks
strategy:
matrix:
include:
- batch: 0
- batch: 1
env:
ANDROID_API_LEVEL: 35
steps:
- name: Connect Bot
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }}
- uses: actions/[email protected]
- uses: actions/[email protected]
continue-on-error: true
with:
name: apks
- uses: ./.github/actions/java-cache
- uses: ./.github/actions/enable-kvm
- uses: ./.github/actions/ruby-cache
- uses: ./.github/actions/gradle-cache
with:
key-prefix: gradle-test
- uses: ./.github/actions/allure-launch
with:
allure-token: ${{ secrets.ALLURE_TOKEN }}
- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ env.ANDROID_API_LEVEL }}
disable-animations: true
profile: pixel
arch : x86_64
emulator-options: ${{ env.EMU_OPTIONS }}
script: bundle exec fastlane run_e2e_test batch:${{ matrix.batch }} batch_count:${{ strategy.job-total }}
- name: Allure TestOps Upload
if: success() || failure()
run: bundle exec fastlane allure_upload
env:
ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }}
LAUNCH_ID: ${{ env.LAUNCH_ID }}
- name: Allure TestOps Launch Removal
if: cancelled()
run: bundle exec fastlane allure_launch_removal
env:
ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }}
LAUNCH_ID: ${{ env.LAUNCH_ID }}
- name: Upload test results
uses: actions/[email protected]
if: failure()
with:
name: test_report
path: |
./**/build/reports/androidTests/*
fastlane/stream-chat-test-mock-server/logs/*
run-tests-nightly:
name: Test Compose Nightly
runs-on: ubuntu-24.04
# if: ${{ github.event_name == 'schedule' }} or ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.run_nightly_checks == 'true' }}
needs: build-compose-apks
strategy:
matrix:
include:
- android_api_level: 35
- android_api_level: 34
- android_api_level: 33
- android_api_level: 32
- android_api_level: 31
- android_api_level: 29
- android_api_level: 28
fail-fast: false
env:
ANDROID_API_LEVEL: ${{ matrix.android_api_level }}
steps:
- name: Connect Bot
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }}
- uses: actions/[email protected]
- uses: actions/[email protected]
continue-on-error: true
with:
name: apks
- uses: ./.github/actions/java-cache
- uses: ./.github/actions/enable-kvm
- uses: ./.github/actions/ruby-cache
- uses: ./.github/actions/gradle-cache
with:
key-prefix: gradle-test
- uses: ./.github/actions/allure-launch
with:
allure-token: ${{ secrets.ALLURE_TOKEN }}
cron: true
- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ env.ANDROID_API_LEVEL }}
disable-animations: true
profile: pixel
arch : x86_64
emulator-options: ${{ env.EMU_OPTIONS }}
script: bundle exec fastlane run_e2e_test
- name: Allure TestOps Upload
run: bundle exec fastlane allure_upload
if: success() || failure()
env:
ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }}
LAUNCH_ID: ${{ env.LAUNCH_ID }}
- name: Allure TestOps Launch Removal
run: bundle exec fastlane allure_launch_removal
if: cancelled()
env:
ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }}
LAUNCH_ID: ${{ env.LAUNCH_ID }}
- name: Upload test results
uses: actions/[email protected]
if: failure()
with:
name: test_report
path: |
./**/build/reports/androidTests/*
fastlane/stream-chat-test-mock-server/logs/*