This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
forked from valora-inc/wallet
-
Notifications
You must be signed in to change notification settings - Fork 2
161 lines (159 loc) · 5.42 KB
/
e2e-ci.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
name: E2E
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
tags:
description: 'End-to-end Tests'
# Cron job to run e2e tests @ 8:30 pm daily on the latest commit on the default branch - main
schedule:
- cron: '30 20 * * *'
# Cancel any in progress run of the workflow for a given PR
# This avoids building outdated code
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
android:
name: Android
runs-on: android-e2e-group
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
check-latest: true
- name: Install package dependencies
run: yarn || yarn
- name: Fail if someone forgot to commit "yarn.lock"
run: git diff --exit-code
- name: Check E2E wallet balance
run: NODE_OPTIONS='--unhandled-rejections=strict' yarn ts-node ./e2e/scripts/check-e2e-wallet-balance.ts
- name: Create Detox Build
run: |
export CELO_TEST_CONFIG=e2e
export ANDROID_SDK_ROOT=$HOME/android-tools
yarn detox build -c android.release
- name: Run Detox
run: >
export ANDROID_SDK_ROOT=$HOME/android-tools &&
export PATH=$ANDROID_SDK_ROOT/platform-tools:$PATH &&
yarn detox test
--configuration android.release
--artifacts-location e2e/artifacts
--take-screenshots=failing
--record-videos=failing
--record-logs=failing
--loglevel info
--debug-synchronization 10000
--workers 3
--headless
--retries 3
--device-boot-args="-snapshot ci_boot"
timeout-minutes: 45
- name: Publish Android JUnit Report
if: always()
uses: mikepenz/action-junit-report@v2
with:
check_name: Android e2e Test Report
report_paths: 'e2e/test-results/junit.xml'
- name: 'Upload Android E2E Artifacts'
if: failure()
uses: actions/upload-artifact@v2
with:
name: android-e2e-artifact
path: e2e/artifacts
- name: 'Upload Android E2E HTML Report'
if: always()
uses: actions/upload-artifact@v2
with:
name: android-e2e-test-report
path: e2e/test-results
ios:
env:
# `if` conditions can't directly access secrets, so we use a workaround
# See https://docs.github.com/en/actions/security-guides/encrypted-secrets#using-encrypted-secrets-in-a-workflow
SECRETS_AVAILABLE: ${{ secrets.SECRETS_AVAILABLE }}
name: iOS
runs-on: ios-e2e-group
steps:
- name: Google Secrets
if: ${{ env.SECRETS_AVAILABLE }}
id: google-secrets
uses: google-github-actions/[email protected]
with:
secrets: |-
EMERGE_API_TOKEN:projects/1027349420744/secrets/EMERGE_API_TOKEN
credentials: ${{ secrets.MAINNET_SERVICE_ACCOUNT_KEY }}
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
check-latest: true
- name: Install package dependencies
run: yarn || yarn
- name: Fail if someone forgot to commit "yarn.lock"
run: git diff --exit-code
- name: Install Ruby dependencies
run: bundle install --path vendor/bundle
- name: Fail if someone forgot to commit "Gemfile.lock"
run: git diff --exit-code
- name: Install CocoaPods dependencies
working-directory: ios
run: bundle exec pod install || bundle exec pod install --repo-update
- name: Fail if someone forgot to commit "Podfile.lock"
run: git diff --exit-code
- name: Check E2E wallet balance
run: NODE_OPTIONS='--unhandled-rejections=strict' yarn ts-node ./e2e/scripts/check-e2e-wallet-balance.ts
- name: Create Detox Build
run: |
export CELO_TEST_CONFIG=e2e
yarn detox build -c ios.release
- name: Upload Detox Build to Emerge
if: |
env.SECRETS_AVAILABLE
&& (github.event_name == 'pull_request' || github.event_name == 'push')
run: yarn ts-node .github/scripts/uploadE2eBuildToEmerge.ts
env:
EMERGE_API_TOKEN: ${{ steps.google-secrets.outputs.EMERGE_API_TOKEN }}
DETOX_CONFIG: ios.release
- name: Run Detox
run: >
yarn detox test
--configuration ios.release
--artifacts-location e2e/artifacts
--take-screenshots=failing
--record-videos=failing
--record-logs=failing
--loglevel info
--debug-synchronization 10000
--workers 6
--retries 3
timeout-minutes: 45
- name: Publish iOS JUnit Report
if: always()
uses: mikepenz/action-junit-report@v2
with:
check_name: iOS e2e Test Report
report_paths: 'e2e/test-results/junit.xml'
- name: 'Upload iOS E2E Artifacts'
if: failure()
uses: actions/upload-artifact@v2
with:
name: ios-e2e-artifact
path: e2e/artifacts
- name: 'Upload iOS E2E HTML Report'
if: always()
uses: actions/upload-artifact@v2
with:
name: ios-e2e-test-report
path: e2e/test-results