forked from mosip/inji-wallet
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[INJI-700] add workflow for ui automation (mosip#1181)
Signed-off-by: adityankannan-tw <[email protected]> Co-authored-by: adityankannan-tw <[email protected]>
- Loading branch information
1 parent
d50a12c
commit 4bbe377
Showing
1 changed file
with
190 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 }} |