-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodemagic.yaml
543 lines (497 loc) · 27.5 KB
/
codemagic.yaml
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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
# scripts:
# - &codesign #Reuse codesigning script
# name: Set up keychain to be used for code signing using Codemagic CLI 'keychain' command
# script: keychain initialize
# name: Fetch signing files
# script: |
# # You can allow creating resources if existing are not found with `--create` flag
# app-store-connect fetch-signing-files "com.onsitemanagementapp.oma" \
# --type IOS_APP_STORE \
# --create
# - name: Set up signing certificate
# script: keychain add-certificates
# - name: Set up code signing settings on Xcode project
# script: xcode-project use-profiles
# # name: Get Flutter packages
# # script: cd . && flutter packages pub get
# # name: Install pods
# # script: find . -name "Podfile" -execdir pod install \;
# # name: Flutter build ipa and automatic versioning
# # script: |
# # flutter build ipa --release \
# # --build-name=6.0.0 \
# # --build-number=$(($(app-store-connect get-latest-testflight-build-number "$APP_STORE_ID") + 1)) \
# # --export-options-plist=/Users/builder/export_options.plist
# definitions:
# environment:
# browserstack_ios_deployment: &browserstack_ios_deployment
# groups: browserstack_creds
# definitions:
# cool_vars: &cool_vars
# meow: 'testing'
# max_build_duration: 120
# env_versions: &env_versions
# flutter: stable
# xcode: 13.4
# cocoapods: default
# # triggering:
# # events:
# # - tag
# # tag_patterns:
# # - pattern: '*'
# # include: true
# environment:
# automatic_ios_signing: &automatic_ios_signing
# groups:
# # - appstore_credentials
# - ios
# - app_gallery
# # - test_ios
# # - slack
# vars:
# BUNDLE_ID: "com.example.kobitionIntegration"
# XCODE_WORKSPACE: "App.xcworspace"
# XCODE_SCHEME: "App"
# XCODE_CONFIG: "Release-dev"
# MARS: "123"
# # browserstack_upload: &browserstack_upload
# # groups:
# # - appstore_credentials
# # vars:
# # TEST: '123'
workflows:
ios-workflow:
name: iOS Workflow
instance_type: mac_mini_m1
environment:
ios_signing:
distribution_type: app_store # or: ad_hoc | development | enterprise
bundle_identifier: com.example.kobitionIntegration
flutter: 3.7.12
xcode: 14.2
# unity: 2021.3.24f1
# cocoapods: 1.12.1
# integrations:
# app_store_connect: $NAME
# integrations:
# app_store_connect: Nevercode
# unity: 2021.3.15f1
# node: 16.16.0
# ruby: 3.0.3
# cache:
# cache_paths:
# - $HOME/Library/Caches/CocoaPods
# triggering:
# events:
# - pull_request
# branch_patterns: # Include or exclude watched branches
# - pattern: "*"
# include: true
# source: true
# when:
# condition: magic
# changeset:
# includes:
# - 'android/'
# cancel_previous_builds: false
# when:
# changeset:
# includes:
# - '.'
scripts:
# - name: Firebase
# script: |
# flutter pub add firebase_core
# # flutter pub add firebase_messaging
# - name: Clean-up
# script: |
# rm -rf /Applications/Xcode-13.3.app
# rm -rf /Applications/Xcode-13.4.app
# rm -rf /Applications/Xcode-14.0.app
# - name: Set up keychain to be used for codesigning using Codemagic CLI 'keychain' command
# script: |
# echo $APP_STORE_CONNECT_PRIVATE_KEY | base64 --decode > codemagic_api_key.p8
# echo $APP_STORE_CONNECT_PRIVATE_KEY
# brew install mono
# brew install mono-libgdiplus
# keychain initialize
# /usr/local/bin/docker --version
# - name: Fetch signing files
# script: |
# app-store-connect fetch-signing-files com.example.kobitionIntegration --type IOS_APP_ADHOC --create
# - name: Use system default keychain
# script: |
# keychain add-certificates
# - *codesign
# - name: Exit build if keyword not defined
# script: |
# set -e
# set -x
# export COMMIT_MSG=$(git log -1 --pretty=%B)
# echo COMMIT_MSG
# if [[ $COMMIT_MSG != *"buildcd"* ]]
# then
# echo "Commit needs to include 'buildcd' in it's message."
# exit 1
# else
# echo "Commit message includes 'buildcd', moving forward..."
# fi
- name: Set up code signing settings on Xcode project
script: |
MARKETING_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" ios/Runner/Info.plist)
echo $MARKETING_VERSION
xcode-project use-profiles --project=**/*.xcodeprojj
# brew update
# brew upgrade --cask chromedriver
# flutter config --enable-web
# chromedriver --port=4444 &
# - name: Dart test
# script: |
# flutter pub global activate dart_code_metrics
# mkdir -p metrics-results
# flutter pub global run dart_code_metrics:metrics analyze lib --reporter=json > metrics-results/dart_code_metrics.json
# test_report: metrics-results/dart_code_metrics.json
# - name: Flutter test
# script: |
# flutter test \
# flutter analyze
# - name: Flutter Integration Tests iOS
# script: |
# flutter emulators --launch apple_ios_simulator
# xcrun simctl shutdown all
# TEST_DEVICE=$(xcrun simctl create test-device com.apple.CoreSimulator.SimDeviceType.iPhone-11 com.apple.CoreSimulator.SimRuntime.iOS-15-0)
# xcrun simctl boot $TEST_DEVICE
# flutter -d $TEST_DEVICE test integration_test
# xcrun simctl boot 0B315533-768E-47B9-AC74-94CDF3FAE84F
# flutter -d 0B315533-768E-47B9-AC74-94CDF3FAE84F test integration_test
- name: Get Flutter packages
script: |
cd . && flutter packages pub get
- name: Install pods
script: |
find . -name "Podfile" -execdir pod install \;
# - name: 🚀 build number
# script: |
# app-store-connect get-latest-app-store-build-number "1496105355"
# - name: Flutter build ipa and automatic versioning
# script: |
# flutter build ipa --export-options-plist=/Users/builder/export_options.plist
# flutter build ios --debug
# - name: Renaming
# script: |
# mv build/ios/ipa/*.ipa build/ios/ipa/jumbo.ipa
# - name: Sofy
# script: |
# curl --location --request POST 'https://api.sofy.ai/api/AppTests/buildUpload' \
# --header "SubscriptionKey: b119d49f-5bb5-400b-9325-4d0840c2d815" \
# --from "applicationFile=@/Users/builder/clone/build/ios/ipa/kobition_integration.ipa"
# - name: Set the app URL and PATH
# script: |
# CURL_RESULT=$( curl -X POST https://api.kobiton.com/v1/apps/uploadUrl \
# -H 'Authorization: Basic bmloYWxuZXZlcmNvZGU6YzBlYjVhYjQtM2YzZi00M2MwLTkzMjUtMWVhNDczMzQ5Y2E4' \
# -H 'Content-Type: application/json' \
# -H 'Accept: application/json' \
# -d '{"filename": "your_desired_binary_name.ipa"}' | jq -r)
# APP_URL=$(jq -r '.url' <<<"$CURL_RESULT")
# APP_PATH=$(jq -r '.appPath' <<<"$CURL_RESULT")
# - name: Upload artifacts to AWS
# script: |
# curl -X PUT “$APP_URL” \
# -H 'content-type: application/octet-stream' \
# -H 'x-amz-tagging: unsaved=true' \
# -T "build/ios/ipa/kobition_integration.ipa"
# - name: Upload to Kobiton
# script: |
# curl -X POST https://api.kobiton.com/v1/apps \
# -H 'Authorization: Basic bmloYWxuZXZlcmNvZGU6YzBlYjVhYjQtM2YzZi00M2MwLTkzMjUtMWVhNDczMzQ5Y2E4' \
# -H 'Content-Type: application/json' \
# -H 'Accept: application/json' \
# -d '{"appPath": “’”$APP_PATH”’”}’
# - name: BrowserStack upload
# script: |
# curl -u "$CREDS" -X POST "https://api-cloud.browserstack.com/app-live/upload" -F "file=@build/ios/ipa/kobition_integration.ipa"
# echo $TEST
# - name: Kobiton integration
# script: |
# APP_URL=$(curl -X POST https://api.kobiton.com/v1/apps/uploadUrl \
# -H 'Authorization: Basic bmloYWxuZXZlcmNvZGU6YzBlYjVhYjQtM2YzZi00M2MwLTkzMjUtMWVhNDczMzQ5Y2E4' \
# -H 'Content-Type: application/json' \
# -H 'Accept: application/json' \
# -d "{\"filename\": \"kobition_integration.ipa\"}" | jq -r '.url')
# CURL_RESULT=$(curl -X POST https://api.kobiton.com/v1/apps/uploadUrl \
# -H 'Authorization: Basic bmloYWxuZXZlcmNvZGU6YzBlYjVhYjQtM2YzZi00M2MwLTkzMjUtMWVhNDczMzQ5Y2E4) \
# -H 'Content-Type: application/json' \
# -d "{\"filename\": \"kobition_integration.ipa\"}" | jq -r '.url')
# APP_URL=$(jq -r '.url' <<<"$CURL_RESULT")
# APP_PATH=$(jq -r '.appPath' <<<"$CURL_RESULT")
# APP_PATH=$(curl -X POST https://api.kobiton.com/v1/apps/uploadUrl \
# -H 'Authorization: Basic bmloYWxuZXZlcmNvZGU6YzBlYjVhYjQtM2YzZi00M2MwLTkzMjUtMWVhNDczMzQ5Y2E4' \
# -H 'Content-Type: application/json' \
# -H 'Accept: application/json' \
# -d "{\"filename\": \"kobition_integration.ipa\"}" | jq -r '.appPath')
# curl -T "${APPPATH}" \
# -H 'content-type: application/octet-stream' \
# -H 'x-amz-tagging: unsaved=true' \
# -X PUT "${APP_URL}"
# curl -X POST https://api.kobiton.com/v1/apps \
# -H 'Authorization: Basic bmloYWxuZXZlcmNvZGU6YzBlYjVhYjQtM2YzZi00M2MwLTkzMjUtMWVhNDczMzQ5Y2E4' \
# -H 'content-type: application/json' \
# -d "{\"filename\": \"kobition_integration.ipa\", \"appPath\": \"${APP_PATH}\"}"
# - name: Pcloudy
# script:|
# curl -X POST -F "file=@/build/ios/ipa/kobition_integration.ipa" -F "source_type=raw" -F "token=93zqy94twt7325vhkg49cbkf" -F "filter=all" https://device.pcloudy.com/api/upload_file
# - name: Get URL for logs
# script: |
# curl -X POST https://api.kobiton.com/v1/revisitPlans/create \
# -H 'Authorization: Basic $KOBITON_CREDENTIALS' \
# -H 'Content-Type: application/json' \
# -H 'Accept: application/json'
artifacts:
- build/ios/ipa/*.ipa
- build/ios/ipa/jumbo.ipa
- /tmp/xcodebuild_logs/*.log
- flutter_drive.log
# - $HOME/Library/Developer/Xcode/DerivedData/**/Build/**/*.app
# - $HOME/Library/Developer/Xcode/DerivedData/**/Build/**/*.dSYM
# publishing:
# # firebase:
# # firebase_service_account: $FIREBASE_SERVICE_ACCOUNT
# # ios:
# # app_id: 1:283169045807:ios:422387f3cbd
# # groups:
# # - ttt
# email:
# recipients:
# notify:
# success: true # To receive a notification when a build succeeds
# failure: true # To not receive a notification when a build fails
# scripts:
# - name: Trigger
# script: |
# curl -H "Content-Type: application/json" \
# -H "x-auth-token: UjW3noRBwGnyBlOOfHhc8suwuNZmhT4XP7SaeXV-Z7c" \
# --data '{
# "appId": "64144a0841c9cf4c07f3f472",
# "workflowId": "react-native-android",
# "branch": "master",
# "environment": {
# "variables": {
# "ARTEFACT_LINK": "_"
# }
# }
# }' \
# https://api.codemagic.io/builds
# publishing:
# # See the following link for details about email publishing - https://docs.codemagic.io/publishing-yaml/distribution/#email
# notify:
# # success: true # To receive a notification when a build succeeds
# # failure: false # To not receive a notification when a build fails
# slack:
# # See the following link about how to connect your Slack account - https://docs.codemagic.io/publishing-yaml/distribution/#slack
# channel: "#test_channel"
# notify_on_build_start: true # To receive a notification when a build starts
# notify:
# success: true # To receive a notification when a build succeeds
# failure: false # To not receive a notification when a build fails
# publishing:
# app_store_connect:
# api_key: $APP_STORE_CONNECT_PRIVATE_KEY # Contents of the API key, can also reference environment variable such as $APP_STORE_CONNECT_PRIVATE_KEY
# key_id: $APP_STORE_CONNECT_KEY_IDENTIFIER # Alphanumeric value that identifies the API key, can also reference environment variable such as $APP_STORE_CONNECT_KEY_IDENTIFIER
# issuer_id: $APP_STORE_CONNECT_ISSUER_ID # Alphanumeric value that identifies who created the API key, can also reference environment variable such as $APP_STORE_CONNECT_ISSUER_ID
# apple_id: [email protected]
# password: zlzx-qsjy-nxje-drqe
# app_store_connect:
# # Use referenced App Store Connect API key to authenticate binary upload
# auth: integration
# - name: Slack custom
# script: |
# curl -X POST -H 'Content-type: application/json' --data '{"text":"Hello, World!"}' $WEBHOOK_URL
# # scripts:
# - name: Publish to Slack
# script: |
# ARTIFACT_URL=$(echo $CM_ARTIFACT_LINKS | jq -r '.[] | select(.name | endswith("'".ipa"'")) | .url')
# curl -0 -v -X POST $WEBHOOK_URL \
# -H 'Content-type: application/json' \
# --data-raw '
# {
# "attachments": [
# {
# "blocks": [
# {
# "type": "section",
# "text": {
# "type": "mrkdwn",
# "text": "Build with build id <https://codemagic.io/app/'"$CM_PROJECT_ID"'/build/'"$CM_BUILD_ID"'>"
# }
# },
# {
# "type": "divider"
# },
# {
# "type": "section",
# "block_id": "section567",
# "text": {
# "type": "mrkdwn",
# "text": "<https://github.com/'"$CM_REPO_SLUG"'> Merge pull request"
# }
# },
# {
# "type": "divider"
# },
# {
# "type": "section",
# "text": {
# "type": "mrkdwn",
# "text": "*Android Artifact Link* <'"$ARTIFACT_URL"'|Download>"
# }
# },
# ]
# }
# ]
# }'
# slack:
# # See the following link about how to connect your Slack account - https://docs.codemagic.io/publishing-yaml/distribution/#slack
# channel: "#test_channel"
# notify_on_build_start: true # To receive a notification when a build starts
# notify:
# success: true # To receive a notification when a build succeeds
# failure: false # To not receive a notification when a build fails
# submit_to_app_store: true
# release_type: AFTER_APPROVAL
android-workflow:
# triggering:
# events:
# - pull_request
# branch_patterns:
# - pattern: '*'
# include: true
# source: true
# - pattern: 'master'
# include: true
# source: false
name: Android Workflow
max_build_duration: 120
instance_type: mac_mini_m1
environment:
vars:
CM_KEYSTORE: Encrypted(Z0FBQUFBQmcwbDY4ZXpPX2hteWxOSkNQU0ZIOWExN1BkZm5DX1VUMXVYbnVSLUtiMVhhMGVqT1ZHVUEweFZlamhDNEpNRXJ6LVQ1TU9QX0E5ZDdycmNjaVQzdHBrY0hpSnZsUl80T2NnWHJnVmc5ZWJHX2tlNkk4WHZYTUJMR01HUXZOVHoxWDhyX0dYVUExbjQyeGZrQ29ObjdfTTNQa1hfUnRkQVlTY3FLOGlPaS1ncWI0ZmlVVFVjc09QZU14TXlLYjRpVF9IcHRZLVFPNkV5Z0xKUzA2dlpFWkQwYnFuMkx0VWNGX1VTaU9UZnVTcWpudDhWakgwOHhnT19TQ3h4M0RORUNNQ1liQks0R1RvZDZxQnByT29zOGJFdVk4RnJSdXRBSy1HaW9JVnJUdVlndS1VZkNET285WDdCaUZhVUZDN1YtTExkem5uSXZmZERSMkI5eHM0cGlWZUlLQkxkTFVWNEd4TFRNYl9uOUFlTi1wMXlld1NsZWQ5eG5fcmdJdDNPYW10alZ5ZWhVNWFjb3E3Q1ZmNTJkTjdYcEh3WnpITlltSDhCS0EwY2FIZFg0b0NsblZUY1BKaHJYc3FueWh3UWd3WkhjaUJJaUpKanNRWG1PVnpOVFVOcDhvS19uZF9aVUZkVnIwSUlSYTRZd25RRGJnc3AyRkFVZHJSR0ZaS1hYUmI3SlpmcG5USlpHQi1NMFJWWFVST19pLWVsZEgzTk5CNFhLS3NZRXNhQUVjdHp2ZUNBdWpWTlRmYldxUjFMMndncV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WxhUGE3c2FlSGFCckRJSWExc3dyVE45bHpzNjJJbTBYa2p0bkxKOGhzYWoxSGNleHpNNFB2VGluNU5oYnNaSXEzLXJTWVk0S2JwazdmSEY3SUx4S0xFQTNPMUVJcEZzdms1ZFZDbV9ERGEtRFZXdTU5X2t6TVZLcnFEcUx5YUpVZ2FBM0NZM0UyeTlxTS1ScWpUNDAzb0ROdVJQTk9ZdlU0bUF6dXJnRjhQMWdWeWItdnA4YTZwVC0yV2RtVm9PT0ZZazlIb21UbHpIMEN6RHR2bXUyMlRoLTN0dF9GcEtjbWZ2NHBsTmZPeHVZbmVENm1KanRvb1VTaDhnWEFXVWZsNm04N3VYZ2c3bFJqb3RyMGtqR1VoemhYUUdZTVJKb0t3dUpSTkR0elhQTVdNVDlYTDRMbnA0ZHZoV3pBQThOUVdCTkoxYnRnYU9IZi1QM1hPSlR3akNJcDdqOD0==) # <-- Put your encrypted keystore file here
CM_KEYSTORE_PASSWORD: Encrypted(Z0FBQUFBQmcwbDdiZmM5aEJpSlVKUlNUUVRhUVczUnh0M1NaaFJ6NjJTMWhiT2R0VHJMdDBpOUM3aDhsU1l2aUtMNzNvd2Q5YlF1dlBYWmJpUFVYakhsUGhHVC1nSW41bEE9PQ==) # <-- Put your encrypted keystore password here
CM_KEY_ALIAS_PASSWORD: Encrypted(Z0FBQUFBQmcwbDdiZmM5aEJpSlVKUlNUUVRhUVczUnh0M1NaaFJ6NjJTMWhiT2R0VHJMdDBpOUM3aDhsU1l2aUtMNzNvd2Q5YlF1dlBYWmJpUFVYakhsUGhHVC1nSW41bEE9PQ==) # <-- Put your encrypted keystore alias password here
CM_KEYSTORE_PATH: /tmp/keystore.keystore
CM_KEY_ALIAS_USERNAME: Encrypted(Z0FBQUFBQmcwbDcweUxYUmxxaTVEeFhxY0hTQWVteUlTMWhiNzVpazlERUFNR1g5akMxLTA4NjVKaXJ2dEdVdDhDRVV5WlNqa25kTW1raDJuYlRiT2o2YW1qTmpMWDc4akE9PQ==) # <-- Put your encrypted keystore alias username here
cocoapods: default
# triggering:
# events:
# - pull_request
# when:
# condition: event.head_commit.message == "test12"
scripts:
# - name: Jave
# script: |
# flutter pub get
# cd android
# brew install zulu17
# JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home /Users/builder/programs/gradle-7.3.1/bin/gradle wrapper --gradle-version 7.6 --distribution-type bin
# gradle --version
# java --version
# - name: Java 17
# script: |
# sudo apt update && sudo apt upgrade -y
# sudo apt-get -y install openjdk-17-jdk
# echo "JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64" >> $CM_ENV
# sudo update-java-alternatives --set java-1.17.0-openjdk-amd64
# - name: Azure
# script: |
# java --version
# HOMEBREW_NO_AUTO_UPDATE=1 brew install azure-cli
- name: Set up key properties
script: |
echo $ANDROID_FIREBASE_SECRET > $FCI_BUILD_DIR/android/app/google-services.json
# echo $FCI_KEYSTORE | base64 --decode > /tmp/keystore.keystore
# # The following script creates key.properties file and stores the credentials in it. As we configure code signing in app/build.gradle file, the following part is unnecessary unless code signing is configured differently as explained in the documentation: https://docs.codemagic.io/flutter-code-signing/android-code-signing/
# cat >> "$FCI_BUILD_DIR/android/key.properties" <<EOF
# storePassword=$FCI_KEYSTORE_PASSWORD
# keyPassword=$FCI_KEY_PASSWORD
# keyAlias=$FCI_KEY_ALIAS
# storeFile=/tmp/keystore.keystore
# EOF
- name: Set up local.properties
script: |
echo "flutter.sdk=$HOME/programs/flutter" > "$FCI_BUILD_DIR/android/local.properties"
- name: Get Flutter packages
script: |
cd . && flutter packages pub get
- name: Build AAB with Flutter
script: |
flutter build apk --release
# - name: Flutter Integration Tests iOS
# script: |
# flutter config --enable-web
# flutter emulators --launch emulator &
# adb wait-for-device
# flutter -d emulator-5554 test integration_test
# mkdir -p test-results-ios
# flutter devices
# xcrun simctl list
# flutter emulators --launch apple_ios_simulator
# flutter -d iPad-Pro test --machine > test-results-ios/flutter.json integration_test
# flutter -d 99B14BF4-7966-4427-ACD1-34BFE4D26A01 test --machine > test-results-ios/flutter.json integration_test
# flutter devices
# test_report: test-results-ios/flutter.json
# ignore_failure: true
# - name: Build universal apk
# script: |
# android-app-bundle build-universal-apk \
# --bundle 'build/**/outputs/**/*.aab' \
# --ks $CM_KEYSTORE_PATH \
# --ks-pass $CM_KEYSTORE_PASSWORD \
# --ks-key-alias $CM_KEY_ALIAS_USERNAME \
# --key-pass $CM_KEY_ALIAS_PASSWORD
artifacts:
- build/**/outputs/**/*.aab
# - build/outputs/**/*.apk
- build/**/outputs/apk/*.apk
- build/**/outputs/**/mapping.txt
- flutter_drive.log
- test-results-ios/*.json
# publishing:
# firebase:
# firebase_service_account: $FIREBASE_SERVICE_ACCOUNT
# android:
# app_id: 1:273401478965:android:eedcfdb1603bb8a31d567c
# groups:
# - mars
# workflows:
# reproduction-web-integration-tests:
# name: Web Integration Test Workflow
# instance_type: mac_mini_m1
# environment:
# flutter: 3.3.9
# xcode: latest
# cocoapods: default
# scripts:
# - |
# #!/usr/bin/env sh
# set -e # exit on first failed command
# echo "Install supported chromedriver"
# CHROME_VERSION=`/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version | awk '{print $3}'`
# CHROME_VERSION_WITHOUT_BUILD_NUMBER=`awk -F '.' '{print $1,$2,$3}' OFS='.' <<< $CHROME_VERSION`
# CHROMEDRIVER_VERSION=`curl -0 https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_VERSION_WITHOUT_BUILD_NUMBER`
# curl -O https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_mac64.zip
# unzip chromedriver_mac64
# echo "Installed chromedriver $CHROMEDRIVER_VERSION"
# # - flutter packages pub get
# - flutter config --enable-web
# - ./chromedriver --port=4444 &
# - flutter -d chrome drive --driver=test_driver/integration_driver.dart --target=integration_test/app_test.dart
# artifacts:
# - flutter_drive.log
# launch-emulator:
# instance_type: mac_pro
# scripts:
# - name: Launch and Setup Emulator
# script: |
# cd $ANDROID_HOME/tools
# emulator -avd emulator &
# adb wait-for-device