-
Notifications
You must be signed in to change notification settings - Fork 6
175 lines (164 loc) · 6.93 KB
/
ui-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
name: Run UI Tests and publish nightly build
on:
workflow_dispatch:
inputs:
appiumTestsBranch:
description: The branch to run from mobile-appium-tests
required: true
default: develop
type: string
testType:
description: The type of test run, one of [MOCKED|E2E]
required: false
type: string
schedule:
- cron: '0 21 * 4-10 1-5'
- cron: '0 22 * 11-12,1-3 1-5'
push:
branches:
- 'release/**'
jobs:
build-and-upload-to-appetize:
runs-on: macos-13
timeout-minutes: 20
name: "Build and upload app to Appetize"
steps:
- name: Cancel previous jobs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Git - Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.ref }}
- name: Upload preview to Appetize
id: appetize-upload
uses: ./.github/actions/appetize-build
with:
build_type: 'nightly'
github-token: ${{ secrets.GITHUB_TOKEN }}
ssh-private-key: ${{ secrets.SSH_KEY }}
known-hosts: ${{ secrets.KNOWN_HOSTS }}
match-password: ${{ secrets.MATCH_PASSWORD }}
match-git-private-key: ${{ secrets.FASTLANE_PASSWORD }}
fastlane-session: ${{ secrets.FASTLANE_SESSION }}
fastlane-password: ${{ secrets.FASTLANE_PASSWORD }}
match-keychain-name: ${{ secrets.MATCH_KEYCHAIN_NAME }}
match-keychain-password: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }}
appetize-api-token: ${{ secrets.APPETIZE_API_TOKEN }}
source-branch: ${{ github.head_ref || github.ref_name }}
pr-number: ""
slack-channel: ${{ secrets.SLACK_MOBILE_SDK_CHANNEL }}
slack-reporter-token: ${{ secrets.SLACK_REPORTER_BOT_TOKEN }}
github-run-id: ${{ github.run_id }}
build-and-upload-to-firebase-and-browserstack:
runs-on: macos-13
timeout-minutes: 20
name: "Distribute app to Firebase and Browserstack"
steps:
- name: Cancel previous jobs
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1
with:
access_token: ${{ github.token }}
- name: Git - Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.ref }}
- name: Select Xcode Version
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: '15.0'
- name: Install SSH key
uses: shimataro/ssh-key-action@d4fffb50872869abe2d9a9098a6d9c5aa7d16be4 #v2.7.0
with:
key: ${{ secrets.SSH_KEY }}
name: id_rsa_github_actions
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387 # v0.9.0
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- uses: ruby/setup-ruby@7d3497fd78c07c0d84ebafa58d8dac60cd1f0763 # v1.199.0
with:
ruby-version: "3.2"
bundler-cache: true
- name: Create Firebase Service Credentials file
run: |
echo "$FIREBASE_CREDENTIALS" > firebase_credentials.json.b64
base64 -d -i firebase_credentials.json.b64 > firebase_credentials.json
env:
FIREBASE_CREDENTIALS: ${{ secrets.FIREBASE_CREDENTIALS }}
- name: Distribute internally on Firebase and upload to Browserstack 🚀
run: |
bundle exec fastlane qa_release
env:
FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
FIREBASE_COMMA_SEPARATED_TEST_GROUPS: ${{ 'primer-internal' }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_GIT_PRIVATE_KEY: ${{ secrets.SSH_KEY }}
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
FASTLANE_SESSION: ${{ secrets.FASTLANE_SESSION }}
MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }}
MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }}
APPETIZE_API_TOKEN: ${{ secrets.APPETIZE_API_TOKEN }}
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
SOURCE_BRANCH: ${{ github.ref }}
- name: Save Browserstack ID
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 #v4.4.3
id: save_browserstack_id_step
with:
name: browserstack_id
path: /var/tmp/browserstack_id.txt
if-no-files-found: error
test-via-browserstack:
runs-on: ubuntu-latest
needs: build-and-upload-to-firebase-and-browserstack
name: "Browserstack test"
if: ${{ inputs.testType == '' }}
strategy:
max-parallel: 1
matrix:
test-type:
- "MOCKED"
- "E2E"
steps:
- name: Git - Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.ref }}
sparse-checkout: .github
- name: Run UI Tests via Browserstack 🧪
id: ui-tests-test-via-browserstack
uses: ./.github/actions/ui-tests
with:
appium-tests-branch: ${{ inputs.appiumTestsBranch }}
test-type: ${{ matrix.test-type }}
gitlab-appium-pull-key: ${{ secrets.GITLAB_APPIUM_PULL_KEY }}
browserstack-user-name: ${{ secrets.BROWSERSTACK_USERNAME }}
browserstack-access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
slack-mobile-sdk-channel: ${{ secrets.SLACK_MOBILE_SDK_CHANNEL }}
slack-reporter-bot-token: ${{ secrets.SLACK_REPORTER_BOT_TOKEN }}
ui-tests-secrets-api-key: ${{ secrets.UI_TESTS_SECRETS_API_KEY }}
test-via-browserstack-manual:
runs-on: ubuntu-latest
needs: build-and-upload-to-firebase-and-browserstack
name: "Browserstack test (manual)"
if: ${{ inputs.testType != '' }}
steps:
- name: Git - Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.ref }}
sparse-checkout: .github
- name: Run UI Tests via Browserstack [${{ inputs.testType }}] 🧪
id: ui-tests-test-via-browserstack
uses: ./.github/actions/ui-tests
with:
appium-tests-branch: ${{ inputs.appiumTestsBranch }}
test-type: ${{ inputs.testType }}
gitlab-appium-pull-key: ${{ secrets.GITLAB_APPIUM_PULL_KEY }}
browserstack-user-name: ${{ secrets.BROWSERSTACK_USERNAME }}
browserstack-access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
slack-mobile-sdk-channel: ${{ secrets.SLACK_MOBILE_SDK_CHANNEL }}
slack-reporter-bot-token: ${{ secrets.SLACK_REPORTER_BOT_TOKEN }}
ui-tests-secrets-api-key: ${{ secrets.UI_TESTS_SECRETS_API_KEY }}