Use CircleCI version 2.1 at the top of your .circleci/config.yml file.
1
version: 2.1
Add the orbs
stanza below your version, invoking the orb:
1
2
orbs:
autify-mobile: autify/autify-mobile@3.3.0
Use autify-mobile
elements in your existing workflows and jobs.
Opt-in to use of uncertified orbs on your organization’s Security settings page.
Upload an Android build file to Autify for Mobile.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
version: '2.1'
orbs:
android: circleci/android@2.0
autify-mobile: autify/autify-mobile@3
jobs:
build-android:
executor:
name: android/android-machine
steps:
- run: echo "Prepare build"
- run: ./gradlew assembleRelease
- persist_to_workspace:
paths: android-release.apk
root: app/build/outputs/apk/release
workflows:
build-upload-android:
jobs:
- build-android
- autify-mobile/build-upload:
build-path: android-release.apk
requires:
- build-android
workspace-id: AAA
Upload an iOS build file to Autify for Mobile.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
version: '2.1'
orbs:
autify-mobile: autify/autify-mobile@3
jobs:
build-ios:
macos:
xcode: 13.4.1
steps:
- run: echo "Prepare build"
- run: >-
xcodebuild -configuration Debug -target hello-world -arch x86_64 -sdk
iphonesimulator
- persist_to_workspace:
paths: hello-world.app
root: build/Debug-iphonesimulator
workflows:
build-upload-ios:
jobs:
- build-ios
- autify-mobile/build-upload:
build-path: hello-world.app
requires:
- build-ios
workspace-id: AAA
Run a test plan for Android build.
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
version: '2.1'
orbs:
android: circleci/android@2.0
autify-mobile: autify/autify-mobile@3
jobs:
build-android:
executor:
name: android/android-machine
steps:
- run: echo "Prepare build"
- run: ./gradlew assembleRelease
- persist_to_workspace:
paths: android-release.apk
root: app/build/outputs/apk/release
workflows:
test-run-build-id:
jobs:
- autify-mobile/test-run:
autify-test-url: https://mobile-app.autify.com/projects/<ID>/test_plans/<ID>
build-id: AAA
test-run-build-path-android:
jobs:
- build-android
- autify-mobile/test-run:
autify-test-url: https://mobile-app.autify.com/projects/<ID>/test_plans/<ID>
build-path: android-release.apk
requires:
- build-android
Run a test plan for iOS build.
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
version: '2.1'
orbs:
autify-mobile: autify/autify-mobile@3
jobs:
build-ios:
macos:
xcode: 13.4.1
steps:
- run: echo "Prepare build"
- run: >-
xcodebuild -configuration Debug -target hello-world -arch x86_64 -sdk
iphonesimulator
- persist_to_workspace:
paths: hello-world.app
root: build/Debug-iphonesimulator
workflows:
test-run-build-id:
jobs:
- autify-mobile/test-run:
autify-test-url: https://mobile-app.autify.com/projects/<ID>/test_plans/<ID>
build-id: AAA
test-run-build-path-ios:
jobs:
- build-ios
- autify-mobile/test-run:
autify-test-url: https://mobile-app.autify.com/projects/<ID>/test_plans/<ID>
build-path: hello-world.app
requires:
- build-ios
Upload a build file to Autify for Mobile.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
access-token | Environment variable storing the access token of Autify for Mobile. | No | AUTIFY_MOBILE_ACCESS_TOKEN | env_var_name |
autify-cli-installer-url | Autify CLI installer URL | No | >- https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/stable/install-cicd.bash | string |
autify-path | A path to `autify`. | No | autify | string |
build-path | File path to the iOS app (*.app) or Android app (*.apk) in the workspace. | Yes | - | string |
executor | Executor name for this job. | No | autify-cli/default | executor |
workspace-id | Workspace ID to upload the build file. | Yes | - | string |
Run a test plan on Autify for Mobile.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
access-token | Environment variable storing the access token of Autify for Mobile. | No | AUTIFY_MOBILE_ACCESS_TOKEN | env_var_name |
autify-cli-installer-url | Autify CLI installer URL | No | >- https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/stable/install-cicd.bash | string |
autify-path | A path to `autify`. | No | autify | string |
autify-test-url | URL of a test plan e.g. https://mobile-app.autify.com/projects/<ID>/test_plans/<ID> | Yes | - | string |
build-id | ID of the already uploaded build. (Note: Either build-id or build-path is required but not both) | No | '' | string |
build-path | File path to the iOS app (*.app) or Android app (*.apk) in the workspace. (Note: Either build-id or build-path is required but not both) | No | '' | string |
executor | Executor name for this job. | No | autify-cli/default | executor |
max-retry-count | Maximum retry count while waiting. The command can take up to `timeout * (max-retry-count + 1)`. Only effective with `wait` | No | '' | string |
timeout | Timeout seconds when waiting. | No | '' | string |
verbose | - | No | true | boolean |
wait | When true, the action waits until the test finishes. | No | false | boolean |
Upload a build file to Autify for Mobile.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
access-token | Environment variable storing the access token of Autify for Mobile. | No | AUTIFY_MOBILE_ACCESS_TOKEN | env_var_name |
autify-cli-installer-url | Autify CLI installer URL | No | >- https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/stable/install-cicd.bash | string |
autify-path | A path to `autify`. | No | autify | string |
build-path | File path to the iOS app (*.app) or Android app (*.apk). | Yes | - | string |
workspace-id | Workspace ID to upload the build file. | Yes | - | string |
Run a test plan on Autify for Mobile.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
access-token | Environment variable storing the access token of Autify for Mobile. | No | AUTIFY_MOBILE_ACCESS_TOKEN | env_var_name |
autify-cli-installer-url | Autify CLI installer URL | No | >- https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/stable/install-cicd.bash | string |
autify-path | A path to `autify`. | No | autify | string |
autify-test-url | URL of a test plan e.g. https://mobile-app.autify.com/projects/<ID>/test_plans/<ID> | Yes | - | string |
build-id | ID of the already uploaded build. (Note: Either build-id or build-path is required but not both) | No | '' | string |
build-path | File path to the iOS app (*.app) or Android app (*.apk). (Note: Either build-id or build-path is required but not both) | No | '' | string |
max-retry-count | Maximum retry count while waiting. The command can take up to `timeout * (max-retry-count + 1)`. Only effective with `wait` | No | '' | string |
timeout | Timeout seconds when waiting. | No | '' | string |
verbose | - | No | true | boolean |
wait | When true, the action waits until the test finishes. | No | false | boolean |
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
# This code is licensed from CircleCI to the user under the MIT license.
# See here for details: https://circleci.com/developer/orbs/licensing
version: 2.1
description: |
CircleCI integration with Autify for Mobile. Upload a build and/or run a test plan with this Orb.
display:
home_url: https://help.autify.com/docs/autify-command-line-interface
source_url: https://github.com/autifyhq/autify-circleci-orb-mobile
orbs:
autify-cli: autify/autify-cli@2
commands:
build-upload:
description: |
Upload a build file to Autify for Mobile.
parameters:
access-token:
default: AUTIFY_MOBILE_ACCESS_TOKEN
description: Environment variable storing the access token of Autify for Mobile.
type: env_var_name
autify-cli-installer-url:
default: https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/stable/install-cicd.bash
description: Autify CLI installer URL
type: string
autify-path:
default: autify
description: A path to `autify`.
type: string
build-path:
description: File path to the iOS app (*.app) or Android app (*.apk).
type: string
workspace-id:
description: Workspace ID to upload the build file.
type: string
steps:
- autify-cli/install:
shell-installer-url: << parameters.autify-cli-installer-url >>
- run:
command: |
#!/usr/bin/env bash
AUTIFY="${INPUT_AUTIFY_PATH}"
ACCESS_TOKEN="${!INPUT_ACCESS_TOKEN}"
if [ -z "${ACCESS_TOKEN}" ]; then
echo "Missing access-token."
exit 1
fi
ARGS=()
function add_args() {
ARGS+=("$1")
}
if [ -n "${INPUT_BUILD_PATH}" ]; then
add_args "${INPUT_BUILD_PATH}"
else
echo "Missing build-path."
exit 1
fi
if [ -n "${INPUT_WORKSPACE_ID}" ]; then
add_args "--workspace-id=${INPUT_WORKSPACE_ID}"
else
echo "Missing workspace-id."
exit 1
fi
export AUTIFY_CLI_USER_AGENT_SUFFIX="${AUTIFY_CLI_USER_AGENT_SUFFIX:=circleci-orb-mobile-build-upload}"
AUTIFY_MOBILE_ACCESS_TOKEN="${ACCESS_TOKEN}" "${AUTIFY}" mobile build upload "${ARGS[@]}"
environment:
INPUT_ACCESS_TOKEN: << parameters.access-token >>
INPUT_AUTIFY_PATH: << parameters.autify-path >>
INPUT_BUILD_PATH: << parameters.build-path >>
INPUT_WORKSPACE_ID: << parameters.workspace-id >>
name: Upload a build file to Autify for Mobile
test-run:
description: |
Run a test plan on Autify for Mobile.
parameters:
access-token:
default: AUTIFY_MOBILE_ACCESS_TOKEN
description: Environment variable storing the access token of Autify for Mobile.
type: env_var_name
autify-cli-installer-url:
default: https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/stable/install-cicd.bash
description: Autify CLI installer URL
type: string
autify-path:
default: autify
description: A path to `autify`.
type: string
autify-test-url:
description: URL of a test plan e.g. https://mobile-app.autify.com/projects/<ID>/test_plans/<ID>
type: string
build-id:
default: ""
description: 'ID of the already uploaded build. (Note: Either build-id or build-path is required but not both)'
type: string
build-path:
default: ""
description: 'File path to the iOS app (*.app) or Android app (*.apk). (Note: Either build-id or build-path is required but not both)'
type: string
max-retry-count:
default: ""
description: Maximum retry count while waiting. The command can take up to `timeout * (max-retry-count + 1)`. Only effective with `wait`
type: string
timeout:
default: ""
description: Timeout seconds when waiting.
type: string
verbose:
default: true
type: boolean
wait:
default: false
description: When true, the action waits until the test finishes.
type: boolean
steps:
- autify-cli/install:
shell-installer-url: << parameters.autify-cli-installer-url >>
- run:
command: |
#!/usr/bin/env bash
AUTIFY="${INPUT_AUTIFY_PATH}"
ACCESS_TOKEN="${!INPUT_ACCESS_TOKEN}"
if [ -z "${ACCESS_TOKEN}" ]; then
echo "Missing access-token."
exit 1
fi
ARGS=()
function add_args() {
ARGS+=("$1")
}
if [ -n "${INPUT_AUTIFY_TEST_URL}" ]; then
add_args "${INPUT_AUTIFY_TEST_URL}"
else
echo "Missing autify-test-url."
exit 1
fi
if [ -n "${INPUT_BUILD_ID}" ] && [ -n "${INPUT_BUILD_PATH}" ]; then
echo "Can't specify both build-id and build-path."
exit 1
elif [ -n "${INPUT_BUILD_ID}" ]; then
add_args "--build-id=${INPUT_BUILD_ID}"
elif [ -n "${INPUT_BUILD_PATH}" ]; then
add_args "--build-path=${INPUT_BUILD_PATH}"
else
echo "Specify either build-id or build-path."
exit 1
fi
if [ "${INPUT_VERBOSE}" -eq 1 ]; then
add_args "--verbose"
fi
if [ "${INPUT_WAIT}" -eq 1 ]; then
add_args "--wait"
fi
if [ -n "${INPUT_TIMEOUT}" ]; then
add_args "-t=${INPUT_TIMEOUT}"
fi
if [ -n "${INPUT_MAX_RETRY_COUNT}" ]; then
add_args "--max-retry-count=${INPUT_MAX_RETRY_COUNT}"
fi
export AUTIFY_CLI_USER_AGENT_SUFFIX="${AUTIFY_CLI_USER_AGENT_SUFFIX:=circleci-orb-mobile-test-run}"
AUTIFY_MOBILE_ACCESS_TOKEN="${ACCESS_TOKEN}" "${AUTIFY}" mobile test run "${ARGS[@]}"
environment:
INPUT_ACCESS_TOKEN: << parameters.access-token >>
INPUT_AUTIFY_PATH: << parameters.autify-path >>
INPUT_AUTIFY_TEST_URL: << parameters.autify-test-url >>
INPUT_BUILD_ID: << parameters.build-id >>
INPUT_BUILD_PATH: << parameters.build-path >>
INPUT_MAX_RETRY_COUNT: << parameters.max-retry-count >>
INPUT_TIMEOUT: << parameters.timeout >>
INPUT_VERBOSE: << parameters.verbose >>
INPUT_WAIT: << parameters.wait >>
name: Run a test plan on Autify for Mobile.
jobs:
build-upload:
description: |
Upload a build file to Autify for Mobile.
executor: << parameters.executor >>
parameters:
access-token:
default: AUTIFY_MOBILE_ACCESS_TOKEN
description: Environment variable storing the access token of Autify for Mobile.
type: env_var_name
autify-cli-installer-url:
default: https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/stable/install-cicd.bash
description: Autify CLI installer URL
type: string
autify-path:
default: autify
description: A path to `autify`.
type: string
build-path:
description: File path to the iOS app (*.app) or Android app (*.apk) in the workspace.
type: string
executor:
default: autify-cli/default
description: Executor name for this job.
type: executor
workspace-id:
description: Workspace ID to upload the build file.
type: string
steps:
- attach_workspace:
at: .
- build-upload:
access-token: << parameters.access-token >>
autify-cli-installer-url: << parameters.autify-cli-installer-url >>
autify-path: << parameters.autify-path >>
build-path: << parameters.build-path >>
workspace-id: << parameters.workspace-id >>
test-run:
description: |
Run a test plan on Autify for Mobile.
executor: << parameters.executor >>
parameters:
access-token:
default: AUTIFY_MOBILE_ACCESS_TOKEN
description: Environment variable storing the access token of Autify for Mobile.
type: env_var_name
autify-cli-installer-url:
default: https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/stable/install-cicd.bash
description: Autify CLI installer URL
type: string
autify-path:
default: autify
description: A path to `autify`.
type: string
autify-test-url:
description: URL of a test plan e.g. https://mobile-app.autify.com/projects/<ID>/test_plans/<ID>
type: string
build-id:
default: ""
description: 'ID of the already uploaded build. (Note: Either build-id or build-path is required but not both)'
type: string
build-path:
default: ""
description: 'File path to the iOS app (*.app) or Android app (*.apk) in the workspace. (Note: Either build-id or build-path is required but not both)'
type: string
executor:
default: autify-cli/default
description: Executor name for this job.
type: executor
max-retry-count:
default: ""
description: Maximum retry count while waiting. The command can take up to `timeout * (max-retry-count + 1)`. Only effective with `wait`
type: string
timeout:
default: ""
description: Timeout seconds when waiting.
type: string
verbose:
default: true
type: boolean
wait:
default: false
description: When true, the action waits until the test finishes.
type: boolean
steps:
- attach_workspace:
at: .
- test-run:
access-token: << parameters.access-token >>
autify-cli-installer-url: << parameters.autify-cli-installer-url >>
autify-path: << parameters.autify-path >>
autify-test-url: << parameters.autify-test-url >>
build-id: << parameters.build-id >>
build-path: << parameters.build-path >>
max-retry-count: << parameters.max-retry-count >>
timeout: << parameters.timeout >>
verbose: << parameters.verbose >>
wait: << parameters.wait >>
examples:
build-upload-android:
description: |
Upload an Android build file to Autify for Mobile.
usage:
version: "2.1"
orbs:
android: circleci/android@2.0
autify-mobile: autify/autify-mobile@3
jobs:
build-android:
executor:
name: android/android-machine
steps:
- run: echo "Prepare build"
- run: ./gradlew assembleRelease
- persist_to_workspace:
paths: android-release.apk
root: app/build/outputs/apk/release
workflows:
build-upload-android:
jobs:
- build-android
- autify-mobile/build-upload:
build-path: android-release.apk
requires:
- build-android
workspace-id: AAA
build-upload-ios:
description: |
Upload an iOS build file to Autify for Mobile.
usage:
version: "2.1"
orbs:
autify-mobile: autify/autify-mobile@3
jobs:
build-ios:
macos:
xcode: 13.4.1
steps:
- run: echo "Prepare build"
- run: xcodebuild -configuration Debug -target hello-world -arch x86_64 -sdk iphonesimulator
- persist_to_workspace:
paths: hello-world.app
root: build/Debug-iphonesimulator
workflows:
build-upload-ios:
jobs:
- build-ios
- autify-mobile/build-upload:
build-path: hello-world.app
requires:
- build-ios
workspace-id: AAA
test-run-android:
description: |
Run a test plan for Android build.
usage:
version: "2.1"
orbs:
android: circleci/android@2.0
autify-mobile: autify/autify-mobile@3
jobs:
build-android:
executor:
name: android/android-machine
steps:
- run: echo "Prepare build"
- run: ./gradlew assembleRelease
- persist_to_workspace:
paths: android-release.apk
root: app/build/outputs/apk/release
workflows:
test-run-build-id:
jobs:
- autify-mobile/test-run:
autify-test-url: https://mobile-app.autify.com/projects/<ID>/test_plans/<ID>
build-id: AAA
test-run-build-path-android:
jobs:
- build-android
- autify-mobile/test-run:
autify-test-url: https://mobile-app.autify.com/projects/<ID>/test_plans/<ID>
build-path: android-release.apk
requires:
- build-android
test-run-ios:
description: |
Run a test plan for iOS build.
usage:
version: "2.1"
orbs:
autify-mobile: autify/autify-mobile@3
jobs:
build-ios:
macos:
xcode: 13.4.1
steps:
- run: echo "Prepare build"
- run: xcodebuild -configuration Debug -target hello-world -arch x86_64 -sdk iphonesimulator
- persist_to_workspace:
paths: hello-world.app
root: build/Debug-iphonesimulator
workflows:
test-run-build-id:
jobs:
- autify-mobile/test-run:
autify-test-url: https://mobile-app.autify.com/projects/<ID>/test_plans/<ID>
build-id: AAA
test-run-build-path-ios:
jobs:
- build-ios
- autify-mobile/test-run:
autify-test-url: https://mobile-app.autify.com/projects/<ID>/test_plans/<ID>
build-path: hello-world.app
requires:
- build-ios