Skip to content

Commit 41f382f

Browse files
authored
Merge pull request #1 from moropo-com/readme-changes
improve readme
2 parents ab69a6f + 88794ed commit 41f382f

File tree

4 files changed

+90
-154
lines changed

4 files changed

+90
-154
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) DCD LIMITED
3+
Copyright (c) devicecloud.dev
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 84 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -1,239 +1,175 @@
1-
# devicecloud.dev - Trigger Mobile App Test Run
1+
# Device Cloud Action
22

3-
This GitHub Action leverages devicecloud.dev to trigger a mobile app UI test.
3+
This action is a swap in replacement for the [Maestro Cloud Action](https://github.com/mobile-dev-inc/action-maestro-cloud)
44

5-
## Installation
5+
It lets you run your flows on [devicecloud.dev](https://devicecloud.dev) to save money and access extra features.
66

7-
1. Navigate to the [GitHub Marketplace](https://github.com/marketplace/actions/dcd-trigger-mobile-app-test-run).
8-
2. On the action page, click `Use latest version` button.
9-
3. Follow the prompts from github to install the action.
7+
# Using the action
108

11-
## Configuration
12-
13-
Here is an example of how to set up the devicecloud.dev GitHub Action in your workflow file:
14-
15-
```yaml
16-
name: devicecloud.dev Mobile App Test Run
17-
on:
18-
push:
19-
branches: [production, staging]
20-
jobs:
21-
build:
22-
runs-on: ubuntu-latest
23-
steps:
24-
- name: devicecloud.dev - Trigger Mobile App Test Run
25-
uses: devicecloud-dev/action-trigger-test-run@v1
26-
with:
27-
api-key: ${{ secrets.DCD_API_KEY }}
28-
app-file: path/to/build.apk
29-
workspace: path/to/workspace
30-
env: '{"VAR_1":"Some variable", "VAR_2":"A different variable"}'
31-
```
32-
33-
In this example, this action will run whenever a push to the production or staging branch occurs.
34-
35-
### Storing Secrets
36-
37-
The `api-key` should be kept private. You can use GitHub secrets to protect it. To add a secret:
38-
39-
1. Navigate to your GitHub repository and click on the `Settings` tab.
40-
2. Click on `Secrets` in the left sidebar.
41-
3. Click `New repository secret`.
42-
4. Enter `DCD_API_KEY` as the name for the secrets, and paste the corresponding key in the value field.
43-
44-
## Inputs
45-
46-
### `api-key`
47-
48-
**Required** - devicecloud.dev Secret Key, find this in your devicecloud.dev dashboard.
49-
It follows the UUID schema, e.g. `85e67636-7652-45a8-94ac-e7cdd7e8f869`, however we recommend using Github Secrets for this parameter and provide as follows:
9+
Add the following to your workflow. Note that you can use the `v1` tag if you want to keep using the latest version of the action, which will automatically resolve to all `v1.minor.patch` versions as they get published.
5010

5111
```yaml
52-
---
53-
- name: devicecloud.dev - Trigger Mobile App Test Run
54-
uses: dcd-com/action-trigger-test-run@v1
12+
- uses: devicecloud.dev/maestro-device-cloud@v1
5513
with:
5614
api-key: ${{ secrets.DCD_API_KEY }}
15+
app-file: <path_to_your_app_file>
5716
```
5817
59-
### `app-file`
18+
# Triggers
6019
61-
**Required if binary-id is not specified** - App binary to run your flows against.
20+
Trigger this action on (1) pushes to your main branch and (2) pull requests opened against your main branch:
6221
6322
```yaml
64-
---
65-
- name: devicecloud.dev - Trigger Mobile App Test Run
66-
uses: dcd-com/action-trigger-test-run@v1
67-
with:
68-
api-key: ${{ secrets.DCD_API_KEY }}
69-
app-file: /path/to/your_app.apk
23+
on:
24+
push:
25+
branches: [master]
26+
pull_request:
27+
branches: [master]
7028
```
7129
72-
### `app-binary-id`
73-
74-
**Required if app-file is not specified** - The ID of the app binary previously uploaded to Maestro Cloud.
30+
If you need to use the `pull_request_target` trigger to support repo forks, check out the HEAD of the pull request to ensure that you're running the analysis against the changed code:
7531

7632
```yaml
77-
---
78-
- name: devicecloud.dev - Trigger Mobile App Test Run
79-
uses: dcd-com/action-trigger-test-run@v1
80-
with:
81-
api-key: ${{ secrets.DCD_API_KEY }}
82-
app-binary-id: your-app-binary-id
33+
on:
34+
push:
35+
branches: [master]
36+
pull_request_target:
37+
branches: [master]
38+
jobs:
39+
run-maestro-on-dcd:
40+
name: Run Flows on devicecloud.dev
41+
steps:
42+
- uses: actions/checkout@v3
43+
with:
44+
ref: ${{ github.event.pull_request.head.sha }} # Checkout PR HEAD
8345
```
8446

85-
### `workspace`
86-
87-
**Required** - The path to the flow file or folder containing your flows.
47+
# Android
8848

8949
```yaml
90-
---
91-
- name: devicecloud.dev - Trigger Mobile App Test Run
92-
uses: dcd-com/action-trigger-test-run@v1
50+
- uses: devicecloud.dev/maestro-device-cloud@v1
9351
with:
9452
api-key: ${{ secrets.DCD_API_KEY }}
95-
workspace: /path/to/flows
53+
app-file: app/build/outputs/apk/debug/app-debug.apk
9654
```
9755

98-
### `env`
56+
`app-file` should point to an x86 compatible APK file, either directly to the file or a glob pattern matching the file name. When using a pattern, the first matched file will be used.
9957

100-
**Required** - One or more environment variables to inject into your flows. The variables must be passed as stringified JSON in the form `{"VAR_1":"VAL_1","VAR_2":"VAL_2"}`
58+
# iOS
10159

10260
```yaml
103-
---
104-
- name: devicecloud.dev - Trigger Mobile App Test Run
105-
uses: dcd-com/action-trigger-test-run@v1
61+
- uses: devicecloud.dev/maestro-device-cloud@v1
10662
with:
10763
api-key: ${{ secrets.DCD_API_KEY }}
108-
env: '{"VAR_1":"Some variable", "VAR_2":"A different variable"}'
64+
app-file: <app_name>.app
10965
```
11066

111-
### `android-api-level`
112-
113-
**Optional** - [Android only] Android API level to run your flow against. Options: `32`, `33`, `34`.
114-
115-
```yaml
116-
---
117-
- name: devicecloud.dev - Trigger Mobile App Test Run
118-
uses: dcd-com/action-trigger-test-run@v1
119-
with:
120-
api-key: ${{ secrets.DCD_API_KEY }}
121-
android-api-level: 33
122-
```
67+
`app-file` should point to an Apple silicon compatible Simulator .app build, either directly to the file or a glob pattern matching the file name. When using a pattern, the first matched file will be used.
12368

124-
### `android-device`
69+
# Custom workspace location
12570

126-
**Optional** - [Android only] Android device to run your flow against. Options: `pixel-6`, `pixel-6a`, `pixel-6-pro`, `pixel-7`, `pixel-7-pro`, `generic-tablet`.
71+
By default, the action is looking for a `.maestro` folder with Maestro flows in the root directory of the project. If you would like to customize this behaviour, you can override it with a `workspace` argument:
12772

12873
```yaml
129-
---
130-
- name: devicecloud.dev - Trigger Mobile App Test Run
131-
uses: dcd-com/action-trigger-test-run@v1
74+
- uses: devicecloud.dev/maestro-device-cloud@v1
13275
with:
13376
api-key: ${{ secrets.DCD_API_KEY }}
134-
android-device: pixel-6
77+
app-file: app.zip
78+
workspace: myFlows/
13579
```
13680

137-
### `async`
81+
# Custom name
13882

139-
**Optional** - Wait for the results of the run asynchronously.
83+
A name will automatically be provided according to the following order:
14084

141-
```yaml
142-
---
143-
- name: devicecloud.dev - Trigger Mobile App Test Run
144-
uses: dcd-com/action-trigger-test-run@v1
145-
with:
146-
api-key: ${{ secrets.DCD_API_KEY }}
147-
async: true
148-
```
149-
150-
### `exclude-flows`
85+
1. If it is a Pull Request, use Pull Request title as name
86+
2. If it is a normal push, use commit message as name
87+
3. If for some reason the commit message is not available, use the commit SHA as name
15188

152-
**Optional** - Subdirectories to ignore when building the flow file list.
89+
If you want to override this behaviour and specify your own name, you can do so by setting the `name` argument:
15390

15491
```yaml
155-
---
156-
- name: devicecloud.dev - Trigger Mobile App Test Run
157-
uses: dcd-com/action-trigger-test-run@v1
92+
- uses: devicecloud.dev/maestro-device-cloud@v1
15893
with:
15994
api-key: ${{ secrets.DCD_API_KEY }}
160-
exclude-flows: 'test/exclude-directory'
95+
app-file: app.zip
96+
name: My Upload
16197
```
16298

163-
### `exclude-tags`
99+
# Run in async mode
164100

165-
**Optional** - Flows which have these tags will be excluded from the run.
101+
If you don't want the action to wait until the Upload has been completed as is the default behaviour, set the `async` argument to `true`:
166102

167103
```yaml
168-
---
169-
- name: devicecloud.dev - Trigger Mobile App Test Run
170-
uses: dcd-com/action-trigger-test-run@v1
104+
- uses: devicecloud.dev/maestro-device-cloud@v1
171105
with:
172106
api-key: ${{ secrets.DCD_API_KEY }}
173-
exclude-tags: 'tag1,tag2'
107+
app-file: app.zip
108+
async: true
174109
```
175110

176-
### `google-play`
111+
# Adding environment variables
177112

178-
**Optional** - [Android only] Run your flow against Google Play devices.
113+
If you want to pass environment variables along with your upload, The variables must be passed as stringified JSON in the form `{"VAR_1":"VAL_1","VAR_2":"VAL_2"}`:
179114

180115
```yaml
181-
---
182-
- name: devicecloud.dev - Trigger Mobile App Test Run
183-
uses: dcd-com/action-trigger-test-run@v1
116+
- uses: devicecloud.dev/maestro-device-cloud@v1
184117
with:
185118
api-key: ${{ secrets.DCD_API_KEY }}
186-
google-play: true
119+
app-file: app.zip
120+
env: '{"VAR_1":"Some variable", "VAR_2":"A different variable"}'
187121
```
188122

189-
### `include-tags`
123+
# Using tags
124+
125+
You can use Maestro [Tags](https://maestro.mobile.dev/cli/tags) to filter which Flows to send to Maestro Cloud:
190126

191-
**Optional** - Only flows which have these tags will be included in the run.
127+
You can either pass a single value, or comma-separated (`,`) values.
192128

193129
```yaml
194-
---
195-
- name: devicecloud.dev - Trigger Mobile App Test Run
196-
uses: dcd-com/action-trigger-test-run@v1
130+
- uses: devicecloud.dev/maestro-device-cloud@v1
197131
with:
198132
api-key: ${{ secrets.DCD_API_KEY }}
199-
include-tags: 'tag3,tag4'
133+
app-file: app.zip
134+
include-tags: dev, pull-request
135+
exclude-tags: excludeTag
200136
```
201137

202-
### `ios-device`
138+
# Specifying Android API Level
203139

204-
**Optional** - [iOS only] iOS device to run your flow against. Options: `iphone-12`, `iphone-12-mini`, `iphone-12-pro-max`, `iphone-13`, `iphone-13-mini`, `iphone-13-pro-max`, `iphone-14`, `iphone-14-plus`, `iphone-14-pro`, `iphone-14-pro-max`, `iphone-15`, `iphone-15-plus`, `iphone-15-pro`,
140+
You can specify what Android API level to use when running in devicecloud.dev using the `android-api-level` parameter.
141+
142+
The default API level is 33. [Refer to docs](https://docs.devicecloud.dev/getting-started/devices-configuration) for available Android emulator API levels.
205143

206144
```yaml
207-
---
208-
- name: devicecloud.dev - Trigger Mobile App Test Run
209-
uses: dcd-com/action-trigger-test-run@v1
145+
- uses: devicecloud.dev/maestro-device-cloud@v1
210146
with:
211147
api-key: ${{ secrets.DCD_API_KEY }}
212-
ios-device: iphone-14
148+
app-file: app.apk
149+
android-api-level: 32
213150
```
214151

215-
### `ios-version`
152+
# Specifying iOS version
153+
154+
You can specify what **major** iOS Version to use when running in devicecloud.dev using the `ios-version` parameter.
216155

217-
**Optional** - [iOS only] iOS version to run your flow against. Options: `15`, `16`, `17`.
156+
The default iOS version is 17. [Refer to docs](https://docs.devicecloud.dev/getting-started/devices-configuration) for available iOS simulator versions.
218157

219158
```yaml
220-
---
221-
- name: devicecloud.dev - Trigger Mobile App Test Run
222-
uses: dcd-com/action-trigger-test-run@v1
159+
- uses: devicecloud.dev/maestro-device-cloud@v1
223160
with:
224161
api-key: ${{ secrets.DCD_API_KEY }}
162+
app-file: app.zip
225163
ios-version: 16
226164
```
227165

228-
### `name`
166+
# Using an already uploaded App
229167

230-
**Optional** - A custom name for your upload (useful for tagging commits etc).
168+
You can use an already uploaded App binary in devicecloud.dev using the `app-binary-id` parameter.
231169

232170
```yaml
233-
---
234-
- name: devicecloud.dev - Trigger Mobile App Test Run
235-
uses: dcd-com/action-trigger-test-run@v1
171+
- uses: devicecloud.dev/maestro-device-cloud@v1
236172
with:
237173
api-key: ${{ secrets.DCD_API_KEY }}
238-
name: 'My Custom Upload Name'
174+
app-binary-id: <your-app-binary-id>
239175
```

action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: 'devicecloud.dev - Trigger Mobile App Test Run'
1+
name: 'Device Cloud Action'
22
author: 'devicecloud.dev'
3-
description: 'Uses devicecloud.dev.com to execute a mobile app UI test'
3+
description: 'Uses devicecloud.dev to execute Maestro mobile tests'
44
inputs:
55
api-key:
6-
description: 'devicecloud.dev Api Key - find this in your app settings in the devicecloud.dev dashboard'
6+
description: 'devicecloud.dev API Key - find this in your app settings in the devicecloud.dev dashboard'
77
required: true
88
app-file:
99
description: 'Path to the build artifact to upload to devicecloud.dev before running the test'

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dcd-github-action",
3-
"description": "devicecloud.dev - Trigger Mobile App Test Run",
3+
"description": "run maestro tests on devicecloud.dev",
44
"author": "devicecloud.dev",
55
"version": "1.0.0",
66
"main": "src/index.ts",
@@ -24,4 +24,4 @@
2424
"@vercel/ncc": "^0.36.1",
2525
"typescript": "^5.1.6"
2626
}
27-
}
27+
}

0 commit comments

Comments
 (0)