-
Notifications
You must be signed in to change notification settings - Fork 15
271 lines (228 loc) · 9.4 KB
/
integration-tests.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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
name: integration-tests
on:
pull_request:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
network:
description: 'MobileCoin Network'
required: true
default: 'testNet'
type: choice
options:
- 'mobiledev'
- 'testNet'
- 'dynamic(alphaDev)'
env:
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
jobs:
set-seed:
runs-on: macos-latest
steps:
- name: Generate Test Account Seed
id: generate-seed
run: |
seed32=`head -c32 </dev/urandom | base64`
echo "account_seed=$seed32" >> $GITHUB_OUTPUT
outputs:
account_seed: ${{ steps.generate-seed.outputs.account_seed }}
fund-test-accounts:
needs: set-seed
runs-on: macos-latest
env:
# Override fastlane tooling variables
FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 180
FASTLANE_XCODEBUILD_SETTINGS_RETRIES: 10
TEST_RUNNER_testAccountSeed: ${{ needs.set-seed.outputs.account_seed }}
TEST_RUNNER_srcAcctEntropyString: ${{ secrets.DYNAMIC_SOURCE_ACCOUNT_ENTROPY }}
steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
files: ./tools
- name: Pod install
working-directory: ./tools/TestSetupClient
run: pod install
- name: Generate Test Accounts
working-directory: ./tools/TestSetupClient
run: fastlane scan --scheme "TestSetupClient"
run-transacting-integration-tests:
needs: [set-seed, fund-test-accounts]
runs-on: macos-latest
env:
# Override fastlane tooling variables
FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 180
FASTLANE_XCODEBUILD_SETTINGS_RETRIES: 10
TEST_RUNNER_testAccountSeed: ${{ needs.set-seed.outputs.account_seed }}
steps:
- name: Echo Seed
run: |
echo "Seed = $TEST_RUNNER_testAccountSeed"
- name: Set Ruby Version to 2.7
uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
with:
ruby-version: '2.7'
bundler-cache: true
- name: Install 'rename' command
run: brew install rename
- name: Install 'xcbeautify'
run: brew install xcbeautify
- name: Checkout Code
uses: actions/checkout@v2
- name: Get Submodules
working-directory: Vendor/libmobilecoin
run: git submodule update --init --depth 1 --recursive
- name: Install Gems
run: |
# bundle config set --local deployment 'true'
bundle config set --local path '.vendor/bundle'
bundle config set --local clean 'true'
bundle check || bundle install
- name: Set the Network
if: ${{ github.event.inputs.network }}
env:
NETWORK_UNDER_TEST: ${{ github.event.inputs.network }}
run: sed -i '' "s/NetworkPreset = \..*/NetworkPreset = .${NETWORK_UNDER_TEST}/" ./Tests/Integration/Common/Fixtures/NetworkConfigFixtures.swift
- name: GCP Service Account
run: |
echo '${{ secrets.GCP_SERVICE_KEY }}' > "service-key.json"
- name: Install Example Gems
working-directory: ./Example
run: |
# bundle config set --local deployment 'true'
bundle config set --local path '.vendor/bundle'
bundle config set --local clean 'true'
bundle check || bundle install
- name: Make Setup
working-directory: ./Example
run: make setup
- name: Provide Dev Credentials
working-directory: ./Example
env:
TEST_DEV_USER: ${{ secrets.DEV_NETWORK_AUTH_USERNAME }}
TEST_DEV_PASSWORD: ${{ secrets.DEV_NETWORK_AUTH_PASSWORD }}
TEST_NET_MNEMONICS: ${{ secrets.TESTNET_TEST_ACCOUNT_MNEMONICS_COMMA_SEPARATED }}
DEV_NET_MNEMONICS: ${{ secrets.MOBILEDEV_TEST_ACCOUNT_MNEMONICS_COMMA_SEPARATED }}
DYNAMIC_FOG_AUTH_SPKI: ${{ secrets.DYNAMIC_FOG_AUTHORITY_SPKI }}
DYNAMIC_SEED_ENTROPIES: ${{ secrets.DYNAMIC_TEST_ACCOUNT_ENTROPIES_COMMA_SEPARATED }}
run: |
bundle exec pod keys set devNetworkAuthUsername "${TEST_DEV_USER}"
bundle exec pod keys set devNetworkAuthPassword "${TEST_DEV_PASSWORD}"
bundle exec pod keys set testNetTestAccountMnemonicsCommaSeparated "${TEST_NET_MNEMONICS}"
bundle exec pod keys set mobileDevTestAccountMnemonicsCommaSeparated "${DEV_NET_MNEMONICS}"
bundle exec pod keys set dynamicFogAuthoritySpki "${DYNAMIC_FOG_AUTH_SPKI}"
bundle exec pod keys set dynamicTestAccountSeedEntropiesCommaSeparated "${DYNAMIC_SEED_ENTROPIES}"
- name: Install pods for Example project
working-directory: ./Example
run: bundle exec pod install --deployment
- name: Generating CocoaPods Keys
run: ./scripts/setkeysfor Example
- name: Make Bootstrap PostKeys
working-directory: ./Example
run: make bootstrap
- name: Run Transacting Integration Tests On Example
working-directory: ./Example
run: |
export SCAN_XCODEBUILD_FORMATTER="xcbeautify"
bundle exec fastlane scan --scheme "Integration Transacting Tests" --device "iPhone 14 Pro" --result_bundle true
- name: Archive Build Results
if: always()
uses: actions/upload-artifact@v3
with:
name: integration-transacting-test-logs
path: |
~/Library/Logs/scan
- name: Archive Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: integration-transacting-test-logs
path: |
./Example/test_output
run-non-transacting-integration-tests:
runs-on: macos-latest
env:
# Override fastlane tooling variables
FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 180
FASTLANE_XCODEBUILD_SETTINGS_RETRIES: 10
steps:
- name: Set Ruby Version to 2.7
uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
with:
ruby-version: '2.7'
bundler-cache: true
- name: Install 'rename' command
run: brew install rename
- name: Install 'xcbeautify'
run: brew install xcbeautify
- name: Checkout Code
uses: actions/checkout@v2
- name: Get Submodules
working-directory: Vendor/libmobilecoin
run: git submodule update --init --depth 1 --recursive
- name: Install Gems
run: |
# bundle config set --local deployment 'true'
bundle config set --local path '.vendor/bundle'
bundle config set --local clean 'true'
bundle check || bundle install
- name: Set the Network
if: ${{ github.event.inputs.network }}
env:
NETWORK_UNDER_TEST: ${{ github.event.inputs.network }}
run: sed -i '' "s/NetworkPreset = \..*/NetworkPreset = .${NETWORK_UNDER_TEST}/" ./Tests/Integration/Common/Fixtures/NetworkConfigFixtures.swift
- name: GCP Service Account
run: |
echo '${{ secrets.GCP_SERVICE_KEY }}' > "service-key.json"
- name: Install Example Gems
working-directory: ./Example
run: |
# bundle config set --local deployment 'true'
bundle config set --local path '.vendor/bundle'
bundle config set --local clean 'true'
bundle check || bundle install
- name: Make Setup
working-directory: ./Example
run: make setup
- name: Provide Dev Credentials
working-directory: ./Example
env:
TEST_DEV_USER: ${{ secrets.DEV_NETWORK_AUTH_USERNAME }}
TEST_DEV_PASSWORD: ${{ secrets.DEV_NETWORK_AUTH_PASSWORD }}
TEST_NET_MNEMONICS: ${{ secrets.TESTNET_TEST_ACCOUNT_MNEMONICS_COMMA_SEPARATED }}
DEV_NET_MNEMONICS: ${{ secrets.MOBILEDEV_TEST_ACCOUNT_MNEMONICS_COMMA_SEPARATED }}
DYNAMIC_FOG_AUTH_SPKI: ${{ secrets.DYNAMIC_FOG_AUTHORITY_SPKI }}
DYNAMIC_SEED_ENTROPIES: ${{ secrets.DYNAMIC_TEST_ACCOUNT_ENTROPIES_COMMA_SEPARATED }}
run: |
bundle exec pod keys set devNetworkAuthUsername "${TEST_DEV_USER}"
bundle exec pod keys set devNetworkAuthPassword "${TEST_DEV_PASSWORD}"
bundle exec pod keys set testNetTestAccountMnemonicsCommaSeparated "${TEST_NET_MNEMONICS}"
bundle exec pod keys set mobileDevTestAccountMnemonicsCommaSeparated "${DEV_NET_MNEMONICS}"
bundle exec pod keys set dynamicFogAuthoritySpki "${DYNAMIC_FOG_AUTH_SPKI}"
bundle exec pod keys set dynamicTestAccountSeedEntropiesCommaSeparated "${DYNAMIC_SEED_ENTROPIES}"
- name: Install pods for Example project
working-directory: ./Example
run: bundle exec pod install --deployment
- name: Generating CocoaPods Keys
run: ./scripts/setkeysfor Example
- name: Make Bootstrap PostKeys
working-directory: ./Example
run: make bootstrap
- name: Run NonTransacting Integration Tests On Example
working-directory: ./Example
run: bundle exec fastlane scan --scheme "Integration NonTransacting Tests" --device "iPhone 14 Pro" --result_bundle true
- name: Archive Build Results
if: always()
uses: actions/upload-artifact@v3
with:
name: integration-non-transacting-test-logs
path: |
~/Library/Logs/scan
- name: Archive Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: integration-non-transacting-test-logs
path: |
./Example/test_output