-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (104 loc) · 3.94 KB
/
e2e-test.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
name: "End-to-end test"
on:
workflow_dispatch:
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-latest
name: "Start Test"
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: feat/passing-tests-only
token: "${{ secrets.GITHUB_TOKEN }}"
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: '16.x'
- name: Install ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7.5'
bundler-cache: true
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'adopt'
cache: 'gradle'
- name: Install Fastlane
run: gem install fastlane
- name: Install wallet sdk
run: |
git config --global url."https://".insteadOf git://
git clone "https://${{secrets.E2E_GITHUB_TOKEN}}@github.com/docknetwork/react-native-sdk.git" ../wallet-sdk
cd ../wallet-sdk
yarn install --network-timeout 1000000
yarn build
- name: Install app dependencies
run: |
git clone --branch ${{ github.event.client_payload.ref || 'main' }} --single-branch "https://${{ secrets.E2E_GITHUB_TOKEN }}@github.com/docknetwork/dock-app.git" ../dock-app
cd ../dock-app
yarn install --network-timeout 1000000
yarn postinstall
yarn sync-sdk
yarn build-sdk
- name: Handle Certs configuration
run: |
cd ../dock-app
rm -rf ./certs
git clone "https://${{ secrets.E2E_GITHUB_TOKEN }}@github.com/docknetwork/dock-app-certs.git" ./certs
mv ./certs/google-play.json ./
cp -rf ./certs/google-services.json ./android/app/
rm -rf ./android/gradle.properties
cp -rf ./certs/gradle.properties ./android/gradle.properties
# Pull env variables from certs repo
# It will inject sentry token in the JS thread
cp -rf ./certs/.env ./
rm -rf /tmp/google-play-cert
cp -rf ./certs/google-play-cert /tmp/google-play-cert
- name: Generate android apk
run: |
cd ../dock-app/android
fastlane package_apk
- name: Install Appium
run: yarn global add [email protected]
- 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: 12000
emulator-options: -no-window -netdelay none -netspeed full -noaudio -no-boot-anim
disable-animations: true
script: |
appium &>/dev/null &
gradle
adb install -r ../dock-app/android/app/build/outputs/apk/release/app-release.apk
adb shell am start -n 'com.dockapp/com.dockapp.MainActivity'
gradle test --stacktrace --info -DsuitXmlFile=mainSuite.xml
- name: Send slack notification
if: always()
uses: edge/simple-slack-notify@master
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
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": "Repository", "value": "${env.GITHUB_REPOSITORY}", "short": true },
{ "title": "Action URL", "value": "${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}"},
]