trigger-test #529
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
name: "End-to-end test" | |
on: | |
workflow_dispatch: | |
inputs: | |
build_number: | |
description: 'Build number e.g v0.4.21 build-692' | |
required: true | |
default: 'v0.4.21 build-692' | |
repository_dispatch: | |
types: [trigger-test] | |
# Auto cancels previous running CI jobs in this PR on each new commit | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.client_payload.ref }} | |
cancel-in-progress: true | |
jobs: | |
start-test: | |
runs-on: macos-13 | |
name: "Start Test" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
ref: main | |
token: "${{ secrets.GITHUB_TOKEN }}" | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: 'adopt' | |
cache: 'gradle' | |
- name: Format APK directory name | |
run: | | |
directory_name=$(echo "${{ github.event.client_payload.build_number || github.event.inputs.build_number }}" | sed 's/ /_/g') | |
echo "DIRECTORY_NAME=$directory_name" >> "$GITHUB_ENV" | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Download file from S3 | |
env: | |
DIRECTORY_NAME: ${{ env.DIRECTORY_NAME }} | |
run: | | |
aws s3 cp s3://dock-wallet/android-apks/$DIRECTORY_NAME/dock-wallet.apk ./app/ | |
- name: Install Appium | |
run: | | |
yarn global add appium | |
appium driver install uiautomator2 | |
appium driver install xcuitest | |
- name: Run E2E Tests | |
uses: ReactiveCircus/android-emulator-runner@v2 | |
with: | |
api-level: 29 | |
arch: x86_64 | |
force-avd-creation: false | |
profile: Nexus 6 | |
ram-size: 16384M | |
disk-size: 16384M | |
emulator-boot-timeout: 600 | |
emulator-options: -no-window -netdelay none -netspeed full -noaudio -no-boot-anim | |
disable-animations: true | |
script: | | |
appium &>/dev/null & | |
gradle | |
adb install -g ./app/dock-wallet.apk | |
adb shell pm grant com.dockapp android.permission.WRITE_EXTERNAL_STORAGE | |
adb shell am start -n 'com.dockapp/com.dockapp.MainActivity' | |
gradle test --info -DsuitXmlFile=mainSuite.xml | |
- name: Parse Test Report | |
if: always() | |
run: | | |
chmod +x ./scripts/ParseReports.sh ./scripts/BuildNumber.sh | |
./scripts/ParseReports.sh | |
./scripts/BuildNumber.sh | |
- name: Send slack notification | |
if: always() | |
uses: edge/simple-slack-notify@master | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
BUILD_NUMBER: ${{ github.event.client_payload.build_number || github.event.inputs.build_number}} | |
with: | |
channel: '#wallet-bot' | |
status: ${{ job.status }} | |
success_text: 'End-to-end test completed successfully' | |
failure_text: 'End-to-end test failed' | |
cancelled_text: 'End-to-end test cancelled' | |
fields: | | |
[ | |
{ "title": "Action URL", "value": "${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}"}, | |
{ "title": "Build Number", "value":"${env.BUILD_NUMBER}"}, | |
{ "title": "Failed Tests", "value":"${env.ALL_FAILED_TESTS}"} | |
] |