forked from mosip/inji-wallet
-
Notifications
You must be signed in to change notification settings - Fork 2
190 lines (168 loc) · 6.2 KB
/
ui-automation.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
179
180
181
182
183
184
185
186
187
188
189
190
name: UI - Automation
run-name: ${{ inputs.runName }}
on:
workflow_dispatch:
inputs:
runName:
description: 'Run name'
required: true
default: 'Device-pool/Test-name/Env'
type: string
buildFor:
description: 'Build'
required: true
default: 'Both[Android and IOS]'
type: choice
options:
- Both[Android and IOS]
- Android
- IOS
testType:
description: 'Sanity/Regression'
required: true
default: 'sanity'
type: choice
options:
- sanity
- regression
backendServiceUrl:
description: 'Mimoto and Esignet backend service URL'
required: true
default: 'https://api.sandbox.mosip.net'
type: string
jobs:
android-ui-automation:
if: ${{ github.event.inputs.buildFor == 'Both[Android and IOS]' || github.event.inputs.buildFor == 'Android'}}
name: Trigger android run
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Cache npm dependencies
uses: actions/[email protected]
with:
path: '~/.npm'
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install npm dependencies
run: |
npm ci
- name: Generate Android keystore
run: |
echo "$ANDROID_KEYSTORE_FILE" > release.keystore.b64
base64 -d -i release.keystore.b64 > android/app/release.keystore
env:
ANDROID_KEYSTORE_FILE: ${{ secrets.INJI_ANDROID_RELEASE_KEYSTORE }}
- name: Create Android Build
run: |
npx jetify
cd android
./gradlew :app:assembleResidentappRelease
env:
MIMOTO_HOST: ${{ github.event.inputs.backendServiceUrl }}
ESIGNET_HOST: ${{ github.event.inputs.backendServiceUrl }}
APPLICATION_THEME: 'orange'
CREDENTIAL_REGISTRY_EDIT: 'false'
RELEASE_KEYSTORE_ALIAS: 'androidreleasekey'
RELEASE_KEYSTORE_PASSWORD: "${{ secrets.INJI_ANDROID_RELEASE_STOREPASS }}"
- name: Configure AWS CLI
run: |
aws configure set aws_access_key_id ${{ secrets.AWS_DEVICE_FARM_ACCESS_KEY }}
aws configure set aws_secret_access_key ${{ secrets.AWS_DEVICE_FARM_SECRET_KEY }}
aws configure set region us-west-2
- name: Android - Automation
id: android-run
run: |
cd injitest/scripts/ui_automation
RUN_ARN=$(./automation_trigger.sh "Android" "$RUN_NAME" "$TEST_TYPE")
echo "The Run ARN is $RUN_ARN"
env:
RUN_NAME: ${{ github.event.inputs.runName }}
TEST_TYPE: ${{ github.event.inputs.testType }}
# - name: Artifacts download
# id: artifact-download
# run: |
# cd injitest/scripts/ui_automation
# ./download_artifacts.sh "${{ steps.android-run.outputs.run_arn }}" "Android"
# - name: Upload Artifact to Actions
# uses: actions/[email protected]
# with:
# name: Automation Artifacts
# path: injitest/scripts/ui_automation/artifacts/
# retention-days: 5
# - name: Update slack channel
# if: always()
# uses: 8398a7/action-slack@v3
# with:
# status: ${{ job.status }}
# fields: repo,message,author,commit,workflow,job
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_INJI_TEAM }}
ios-ui-automation:
if: ${{ github.event.inputs.buildFor == 'Both[Android and IOS]' || github.event.inputs.buildFor == 'IOS'}}
name: Trigger ios run
runs-on: macos-13
steps:
- uses: actions/[email protected]
- uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Cache npm dependencies
uses: actions/[email protected]
with:
path: '~/.npm'
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install npm dependencies
run: |
npm ci
- name: Create iOS Build
run: |
cd ios
pod install && pod install
fastlane ios_ui_automation_build
env:
MIMOTO_HOST: ${{ github.event.inputs.backendServiceUrl }}
ESIGNET_HOST: ${{ github.event.inputs.backendServiceUrl }}
APPLICATION_THEME: 'orange'
APP_FLAVOR: 'residentapp'
CREDENTIAL_REGISTRY_EDIT: 'false'
INJI_IOS_TEMP_KEYCHAIN_PASSWORD: '${{ secrets.INJI_IOS_TEMP_KEYCHAIN_PASSWORD }}'
INJI_IOS_TEMP_KEYCHAIN_USER: '${{ secrets.INJI_IOS_TEMP_KEYCHAIN_USER }}'
GIT_AUTHORIZATION: '${{ secrets.GIT_AUTHORIZATION }}'
- name: Configure AWS CLI
run: |
aws configure set aws_access_key_id ${{ secrets.AWS_DEVICE_FARM_ACCESS_KEY }}
aws configure set aws_secret_access_key ${{ secrets.AWS_DEVICE_FARM_SECRET_KEY }}
aws configure set region us-west-2
- name: IOS - Automation
run: |
cd injitest/scripts/ui_automation
RUN_ARN=$(./automation_trigger.sh "IOS" "$RUN_NAME" "$TEST_TYPE")
echo "The Run ARN is $RUN_ARN"
env:
RUN_NAME: ${{ github.event.inputs.runName }}
TEST_TYPE: ${{ github.event.inputs.testType }}
# - name: Artifacts download
# id: artifact-download
# run: |
# cd injitest/scripts/ui_automation
# ./download_artifacts.sh "${{ steps.android-run.outputs.run_arn }}" "Android"
# - name: Upload Artifact to Actions
# uses: actions/[email protected]
# with:
# name: Automation Artifacts
# path: injitest/scripts/ui_automation/artifacts/
# retention-days: 5
# - name: Update slack channel
# if: always()
# uses: 8398a7/action-slack@v3
# with:
# status: ${{ job.status }}
# fields: repo,message,author,commit,workflow,job
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_INJI_TEAM }}