Skip to content

Commit c74e843

Browse files
authored
Merge pull request #7 from devicecloud-dev/intelligent-retries
support intelligent retries
2 parents 6a03638 + 9cf2a31 commit c74e843

File tree

5 files changed

+24
-2
lines changed

5 files changed

+24
-2
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,3 +269,15 @@ Specify an iOS device model to run your tests on:
269269
app-file: app.zip
270270
ios-device: iphone-14
271271
```
272+
273+
# Retry parameter
274+
275+
The `retry` parameter allows you to specify the number of times to retry the run if it fails. This is the same as pressing retry in the UI, and it will deduct credits from your account. Max is 3 retries.
276+
277+
```yaml
278+
- uses: devicecloud-dev/device-cloud-for-maestro@v1
279+
with:
280+
api-key: ${{ secrets.DCD_API_KEY }}
281+
app-file: app.apk
282+
retry: 3
283+
```

action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,15 @@ inputs:
6363
description: 'A custom name for your upload (useful for tagging commits etc)'
6464
required: false
6565
orientation:
66-
description: 'Android only - The orientation of the device to run your flow against in degrees (0|90|180|270)'
66+
description: 'Android only - The orientation of the device to run your flow against in degrees (90|180|270)'
6767
required: false
6868
workspace:
6969
description: 'Path to a folder that contains your test flows'
7070
required: false
7171
default: './.maestro/'
72+
retry:
73+
description: 'Number of times to retry the run if it fails (same as pressing retry in the UI, this will deduct credits from your account)'
74+
required: false
7275

7376
runs:
7477
using: 'node20'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "dcd-github-action",
33
"description": "run maestro tests on devicecloud.dev",
44
"author": "devicecloud.dev",
5-
"version": "1.1.2",
5+
"version": "1.2.0",
66
"main": "src/index.ts",
77
"license": "MIT",
88
"engines": {

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const run = async (): Promise<void> => {
2626
maestroVersion,
2727
name,
2828
orientation,
29+
retry,
2930
workspaceFolder,
3031
} = await getParameters();
3132

@@ -51,6 +52,7 @@ const run = async (): Promise<void> => {
5152
'maestro-version': maestroVersion,
5253
name,
5354
orientation,
55+
retry,
5456
};
5557

5658
let paramsString = Object.keys(params).reduce((acc, key) => {

src/methods/params.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export type Params = {
2424
downloadArtifacts?: 'ALL' | 'FAILED';
2525
maestroVersion?: string;
2626
orientation?: 0 | 90 | 180 | 270;
27+
retry?: number;
2728
};
2829

2930
function getAndroidApiLevel(apiLevel?: string): number | undefined {
@@ -191,6 +192,9 @@ export async function getParameters(): Promise<Params> {
191192
const androidApiLevel = getAndroidApiLevel(androidApiLevelString);
192193
const iOSVersion = getIOSVersion(iOSVersionString);
193194

195+
const retry =
196+
parseInt(core.getInput('retry', { required: false })) || undefined;
197+
194198
return {
195199
apiUrl,
196200
apiKey,
@@ -214,5 +218,6 @@ export async function getParameters(): Promise<Params> {
214218
downloadArtifacts,
215219
maestroVersion,
216220
orientation,
221+
retry,
217222
};
218223
}

0 commit comments

Comments
 (0)